Local python package install doesn't copy package any more?

Viewed 49

This used to work but I don't know what changed; nothing has changed in this repo for a while.

I have a local python package that I want to install via pip. My source tree looks like:

./local_packages/my-package-0.0.3.tar.gz

and my requirements.txt has only

my-package

I run

pip install --find-links="./local_packages" --target=./python_modules/ -r requirements.txt

This finds my package and installs it in python_modules but I can't import it:

Python 3.6.7 (default, Nov 30 2020, 14:15:49) 
[GCC Apple LLVM 12.0.0 (clang-1200.0.32.27)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from my_package import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'my_package'

When I look in python_modules I see all of the dependencies of my-package as well as my_package-0.0.3-py3.6.egg-info/ but there is no module for just my_package.

If I downgrade pip from 20.3 to 19.3.1, then I see what I was expecting, with both a folder for .egg-info as well as for the module itself. My import works correctly etc.

Is this expected behavior? Am I missing something?

0 Answers
Related