question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pip picks up .egg-info from sub-folders in -e mode

See original GitHub issue

Environment

  • pip version: 10.0.1
  • Python version: 3.6 (running in a conda env)
  • OS: Windows

Description When I try to install my own package in -e mode, pip instead tries to install the dependencies of another package in a sub-folder of the current directory.

Pip behaves fine in non-development mode.

Expected behavior Pip should resolve the correct package obviously.

How to Reproduce I have a minimal example to demonstrate the issue.

Run pip -e ., and pip will install numpy, instead of mypkg and attrs.

Additional info It seems that pip picks up an *.egg-info that happens to be located exactly one level below the current directory. It then tries to resolve the dependencies indicated there. In my case, I grabbed the egg-info from pyqtgraph.

My project does not use the usual directory layout (where setup.py is located next to a folder named after the package, containing the source code). I don’t see how this would be an issue though.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
sbidoulcommented, Apr 13, 2020

@polwel This should be resolved in pip master following https://github.com/pypa/pip/pull/7978

1reaction
chrahuntcommented, Sep 3, 2019

The problem is using the “src” directory layout. Currently we determine where the generated *.egg-info file is based on a traversal of the source tree. If more than one *.egg-info found then we take the first ordered by number of leading directories. Since your .egg-info ends up in src, it doesn’t necessarily have precedence over the one in pyqtgraph.

Does anyone know why we aren’t passing an explicit --egg-base to setup.py egg_info so we know for sure where the .egg-info directory is being created?

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - pip: Why sometimes installed as egg ... - Stack Overflow
Since posting I've learned 'pip install' with '-e', editable option; installs the package in 'devloper mode'. A /srv/mypkg-1.1.0/mypkg.egg-info ...
Read more >
egg-info in local directory makes pip think package is installed
pip install would install the package in the wheel file to the appropriate site-packages directory, so that it remains available after chdir-ing ...
Read more >
Practical-Linux-Forensics-A-Guide-for-Digital-Investigators.pdf
make up a “modern” Linux system today. After providing this dual founda tion, the rest of the book focuses on the forensic analysis...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found