Warning about unhelpful interaction between `conda`, `pip` and Python
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24
- Forks
- 15
- Avg merge
- 10d 3h
- Merged PRs (30d)
- 1
Description
Notes
Strange interaction between python, pip and conda we encountered on Cheaha.
Researcher wants to install conda environment from a YML file. Unable to do so due to an error (with package mypy_extensions) when installing pip dependencies. I am unable to reproduce no matter how closely I align our environments, module reset, conda clean --all. Same error every time.
Today I noticed that the error is from a python file in ~/.local/ rather than the expected ~/.conda/. Digging further, we uncover that it is possible for pip packages to be placed in ./local/lib/python#.#/site-packages even when using pip from within an Anaconda environment. It is not clear yet why this happens.
By default, the CPython interpreter uses ~/.local/lib/python#.#/site-packages as the first location to find imports, then other PYTHONPATH locations (like Anaconda). We had the researcher clear out those directories and the environment installed correctly.
What we don't know is the exact conditions that will cause a package to be placed in ~/.local instead of ~/.conda. From my own heavily-used environments, it appears the last version in ~/.local is python3.9, so I suspect at some point between 3.9 and 3.10, the issue was resolved. What we also don't know is which part of the ecosystem causes the issue.
- Is it pip being unaware of Anaconda?
- Is it python version specific?
- Is it conda not informing pip of what path to use?
- Is it related to order of package installation when using multiple
conda installcommands?
At any rate, it appears that recent versions of Anaconda, pip and Python don't reproduce this issue. I'll see if I can do a bit more digging to find the boundaries.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file, test, or entry point is named. Start by identifying where guidance about conda, pip, and Python environments is maintained, then investigate the conditions that place packages in ~/.local rather than ~/.conda. Done means documenting a verified warning and guidance, or recording that current versions no longer reproduce the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100