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 trying to import a custom package(s) into my Jupyter Notebook, but I'm having issues using the setup_tools provided by cookiecutter. The package(s) work when I open my termina and run the python3 shell, however I get a 'no module error' when importing the package into my notebook.
I've set up a virtual environment with python3 -m venv and installed the setup.py with pip3 install --editable .
This is my project structure, which is exactly what is provided in cookiecutter
If the package can be imported correctly into my python shell, why can't it be imported into my notebook? Is this a permissions issue, and if so how can I check that?
Here is the SOURCES.txt generated from the setup.py
I would guess that when you run jupyter it is not part of your environment where the package is installed.
If you run which python3 you should see the environment name in the path to the python3 executable. If you run which jupyter I suspect you will not see your environment name in the path.
To fix this, within the environment run pip install jupyter. Then if you use the jupyter within the environment, it should work. (Check by running which jupyter again).
I'm trying to import a custom package(s) into my Jupyter Notebook, but I'm having issues using the setup_tools provided by
cookiecutter
. The package(s) work when I open my termina and run thepython3
shell, however I get a 'no module error' when importing the package into my notebook.I've set up a virtual environment with
python3 -m venv
and installed thesetup.py
withpip3 install --editable .
This is my project structure, which is exactly what is provided in cookiecutter
I also know I've correctly installed the package:
In my terminal:
However, when I run import src in my notebook, I get:
This is my
setup.py
If the package can be imported correctly into my python shell, why can't it be imported into my notebook? Is this a permissions issue, and if so how can I check that?
Here is the
SOURCES.txt
generated from thesetup.py
So now I'm more confused on why it won't import.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: