python installing package with submodules
问题 I have a custom project package with structure like: package-dir/ mypackage/ __init__.py submodule1/ __init__.py testmodule.py main.py requirements.txt setup.py using cd package-dir followed by $pip install -e . or pip install . as suggested by python-packaging as long as I access the package from package-dir For example : $cd project-dir $pip install . at this point this works: $python -c 'import mypackage; import submodule1' but This does not work $ cd some-other-dir $ python -c 'import