You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm in ch06_routing and trying to setup the blueprints. register_blueprints is throwing the error:
ModuleNotFoundError: No module named 'pypi_org' all of the imports.
For example from pypi_org.views import home_views and from pypi_org.views import package_views both cause the error. I do have a views directory inside of the pypi_org directory, and app.py is at the root of pypi_org.
Inside of the views directory the import of services does not cause this error (import pypi_org.services.package_service as package_service runs with no error).
I can't figure out why I am getting the error in the app.py file.
The text was updated successfully, but these errors were encountered:
In the video from the course things were working without those two lines. Is it a PyCharm thing that made it work? I'm using VSCode so maybe that is why I had an issue before adding this?
Hi @sanders41 Glad you got that line in there. Yes, this is working because PyCharm patches things up to work as if the project is a package (mostly). Whereas VS code and others just run the Python file. Basically, look at this part of the config:
[From the run configuration]
See the bit about adding content paths as source roots? That's happening automatically there but not when you run without PyCharm, hence the lines you added.
I'm in ch06_routing and trying to setup the blueprints. register_blueprints is throwing the error:
For example
from pypi_org.views import home_views
andfrom pypi_org.views import package_views
both cause the error. I do have a views directory inside of the pypi_org directory, and app.py is at the root of pypi_org.Inside of the views directory the import of services does not cause this error (
import pypi_org.services.package_service as package_service
runs with no error).I can't figure out why I am getting the error in the app.py file.
The text was updated successfully, but these errors were encountered: