How to install PyPi packages using anacaonda conda

2019-01-17 01:52发布

When using the Anacoda Python distribution, what is the best way to install a PyPi package that isn't available directly through Anaconda? For now I'm using:

conda pipbuild [pypi_name]
conda install --use-local [package_spec]

But I'm unclear if this is the best way and if conda update --all will update these packages when updates are made available. I'm also unclear what the point of binstar is when PyPi already exists.

2条回答
走好不送
2楼-- · 2019-01-17 02:08

If you want to build conda packages for PyPI packages, the recommended way is to use conda skeleton pypi package and use conda build package on the recipe that it creates. You will need to update the recipe each time the package is updated.

You can also use pip to install these packages. The disadvantage here is that these packages wont' be managed by conda at all.

查看更多
趁早两清
3楼-- · 2019-01-17 02:12

I will disagree with the accepted response and note that pip install [some-pypi-package] is often the best way to install PyPi packages in Conda environments.

While the packages won't be managed by the Conda package manager, they will still be managed by the Anaconda environment. It will download the correct version of the package for the active Python install and update it correctly using the pip package manager.

When using Anaconda, you should turn to conda before pip when you can, but you don't lose any of the replicability benefits of using Anaconda when you use pip.

查看更多
登录 后发表回答