Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

conda equivalent of pip install

If I have a directory with setup.py, in pip, I can pip install . in the directory to install the package.

What if I am using conda?

conda install . makes conda to find a package named dot.

like image 217
youkaichao Avatar asked Feb 10 '19 16:02

youkaichao


1 Answers

conda packages are a different structure than standard python packaging. As a result, the official, recommended and best-practice approach is to use conda to install pip within an activated conda environment, and use that to install standard packages:

conda install pip

NOTE: You want to use conda packages whenever they're available, as they have more features within a conda environment than non-conda packages.

conda install pip will install pip within the currently activated conda environment, and will ensure that it is integrated with conda so that, for example, conda list, will include any packages installed with pip.

NOTE: Commands like conda update will ignore pip installed packages, as it only checks conda channels for available updates, so they still need to be updated using pip. See this Question/Answer discussion:

Does conda update packages from pypi installed using pip install?

NOTE: See @kalefranz comment below regarding conda 4.6 experimental handling of packages.

If you're interested in creating your own conda package(s), take a look at this question/1st answer for a great run-down:

How to install my own python module (package) via conda and watch its changes

If you simply wish to install non-conda packages, using pip is the correct, and expected, way to go.

like image 100
Chris Larson Avatar answered Sep 27 '22 20:09

Chris Larson