Importing local packages in python

Viewed 48

Python: 3.10.4 Windows: 10

Ok so I have been struggling with this for while now.

I've been testing module imports in python. I'm using https://github.com/tomchen/example_pypi_package as a (very useful) example. I run the following:

git clone https://github.com/tomchen/example_pypi_package
cd example_pypi_package
python -m setup.py develop
pip install -e .

Now, I expect to be able to import example_pypi_package in the REPL of that environment.

import example_pypi_package.module1

Yet I get ModuleNotFoundError.

How? I checked that my sys.path is correct and in my Lib\site-packages there is an example_pypi_package.egg-info file. I checked that my sys.execuatble is the correct environment and installed it with pip within that environment. The package shows up in pip list. What am I missing? I can't import the package not even import subpackages of that package.

1 Answers
Related