Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'pypi_org' error #27

Open
DamoM73 opened this issue Sep 25, 2023 · 1 comment
Open

ModuleNotFoundError: No module named 'pypi_org' error #27

DamoM73 opened this issue Sep 25, 2023 · 1 comment

Comments

@DamoM73
Copy link

DamoM73 commented Sep 25, 2023

I am having trouble with the Jinja2 templates and the routing and URLs tutorials.

When I follow your code and use:

from pypi_org.infrastructure.view_modifiers import response
import pypi_org.services.package_service as package_service

I get the error:
ModuleNotFoundError: No module named 'pypi_org'

The error doesn't occur when I change the code to:

from infrastructure.view_modifiers import response
import services.package_service as package_service

What am I doing wrong?

@mikeckennedy
Copy link
Member

Hi. The problem is you are not running the app from the correct working directory. For example, use this one:

https://github.com/talkpython/data-driven-web-apps-with-flask/tree/master/app/ch11_migrations/final

Notice it must the the folder that contains the pypi_org folder.

Alternatively, in PyCharm, set the folder containing the pypi_org folder as "sources root". Make sure to only have one of these active at a time.

Best,
Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants