use*_*844 26 python pip pypi anaconda conda
使用Anacoda Python发行版时,安装不能通过Anaconda直接获得的PyPi包的最佳方法是什么?现在我正在使用:
conda pipbuild [pypi_name]
conda install --use-local [package_spec]
Run Code Online (Sandbox Code Playgroud)
但我不清楚这是否是最佳方式,如果conda update --all在更新可用时更新这些包.我也不清楚当PyPi已经存在时binstar的意义何在.
Chr*_*lan 32
我不同意接受的响应并注意到这pip install [some-pypi-package]通常是在Conda环境中安装PyPi包的最佳方式.
虽然这些软件包不会由Conda软件包管理器管理,但它们仍将由Anaconda环境管理.它将为活动Python安装下载正确版本的软件包,并使用pip软件包管理器正确更新.
当使用蟒蛇,你应该转向conda前pip时,你可以,但你不会失去任何的当您使用使用蟒蛇的可复制性的好处pip.
asm*_*rer 28
如果要为PyPI包构建conda包,建议的方法是在其创建的配方上使用conda skeleton pypi package和使用conda build package.每次更新包时,您都需要更新配方.
您还可以使用pip安装这些包.这里的缺点是这些包装根本不会由conda管理.
从4.6.0版开始,Conda改进了与pip的互操作性:
Conda and pip have historically had difficulties getting along. Pip hasn’t respected Conda’s environment constraints, while Conda has been all too happy to clobber pip-installed software. It’s a mess. Conda 4.6.0 adds preview support for better interoperability. With this interoperability, Conda can use pip-installed packages to satisfy dependencies, and can even remove pip-installed software cleanly and replace them with Conda packages when appropriate. There’s still room for improvement before pip and Conda are hunky-dory BFFs, but we hope this is a good start. This feature is disabled by default right now because it can significantly impact Conda’s performance. If you’d like to try it, you can set this condarc setting:
conda config --set pip_interop_enabled True
Run Code Online (Sandbox Code Playgroud)
So, the way to get PyPI packages into conda (at the time of writing this) seems to be:
pip install <package>
Run Code Online (Sandbox Code Playgroud)
If you want conda to replace the PyPI packages with its own (where possible), just run:
conda update --all
Run Code Online (Sandbox Code Playgroud)
Given that the above setting is made. Conda marks its own channels as higher priority than pip, thus packages will be replaced.