data-driven-web-apps-with-flask icon indicating copy to clipboard operation
data-driven-web-apps-with-flask copied to clipboard

ModuleNotFoundError: No module named 'pypi_org' error

Open DamoM73 opened this issue 2 years ago • 1 comments

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?

DamoM73 avatar Sep 25 '23 23:09 DamoM73

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

mikeckennedy avatar Sep 26 '23 00:09 mikeckennedy