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.

Marking conda as installer for pip packages

See original GitHub issue

All of the python package recipes which have python -m pip install ... or just pip install ... create one problem. They install a file by the name ‘INSTALLER’ in the dist-info directory. For example:

$ cat /Users/nwani/m3/envs/test/lib/python3.7/site-packages/dbf-0.97.11.dist-info/INSTALLER
pip

This is bad, because the from a user’s perspective, when an end user does: conda install dbf this package is installed via ‘conda’ and not ‘pip’. The upcoming release of pip will have a new function was_installed_by_pip(): This is going to be used for not telling the user to pip install --upgrade pip if pip is not installed via pip. I was thinking of extending it to all packages not installed by pip pypa/pip#5605 .

So, what would you recommend, conda-forge? Should we:

  • stop using pip install and use the old --single-version-externally-managed
  • start doing echo conda > /path/to/pkg-pkgversion.dist-info/INSTALLER
  • add a patch to pip which adds an argument to mark the installer
  • delete the INSTALLER file?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ChrisBarker-NOAAcommented, Jul 20, 2018

This is tricky, as people use conda and pip together. So when someone “pip installs” something, we DO want pip to think that any already-there dependencies were installed by pip (or, I guess, just that they are installed). Which is why we’ve been installing stuff with pip in conda-build.

also – the theory is that pip might install packages that are built with tools other than setuptools – so we can have one front end to all python package builders/installers.

So if pip does grow a way to indicate whether a package is being managed by pip, it would be really nice if it could still install a package, but optionally say “don’t try to manage this one”. SO maybe a PR to pip is in order. (or a post-install hack)

Of course making sure pip knows it is not managing itself is a good idea – that could get ugly.

and I do like @jakirkham’s idea of a generic python “compiler” that could be managed in one place as these things change – could we add a {{ installer("python") }} instead?

-CHB

0reactions
jjhelmuscommented, Jul 24, 2018

I would be in favor of recording conda or something similar in the INSTALLER file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make conda recognize pip installed python packages?
When trying to install scipy, conda wants to install numpy in parallel of pip installed numpy....? How to make various installed be recognized ......
Read more >
Installing pip packages with Anaconda | HolyPython.com
Lots of major Python packages have instructions to install with Anaconda. It usually goes something like this: conda install libraryname.
Read more >
Environments, Conda, Pip, aaaaah! | by Dennis Bakhuis
Conda is a popular package manager for Python (and many other languages) and gives you access practically all Python versions and packages. It ......
Read more >
Managing packages - Anaconda Documentation
Installing a different package version¶ ... In the menu that appears, select Mark for specific version installation. If other versions are available for...
Read more >
Add Python packages using the conda package manager
If the specific package you are looking for is available from anaconda.org (formerlly binstar.org), you can easily install it and required dependencies by...
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