使用pip在anaconda上安装python包有什么作用? [英] What is the effect of using pip to install python packages on anaconda?

查看:178
本文介绍了使用pip在anaconda上安装python包有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了新的anaconda v4.4.我意识到可以使用conda和pip来安装python软件包.使用anaconda时,使用pip来安装python软件包而不是conda有什么作用? pip安装的库是否会停止运行?我正在使用python v3

I have installed a fresh anaconda v4.4. I realized that python packages can be installed using both conda and pip. What is the effect of using pip to install python packages instead of conda when using anaconda? Will the pip-installed libraries cease to function? I am using python v3

我不认为问题是 pip和conda有什么区别? 这个问题解释了pip和conda之间的区别,但是没有讨论在可以使用conda时使用pip的效果.

I don't think the question is a duplicate of What is the difference between pip and conda? That question explains the difference between pip and conda but does not talk about the effect of using pip when conda can be used.

推荐答案

如果您使用pip安装vs conda,一切可能都能正常工作.但是,Conda无法管理pip已安装的依赖项-它无法升级或删除它们.更重要的是,conda将安装软件包,即使已使用pip 安装了该软件包!试试这个测试:

Everything might keep working if you use pip to install vs conda. However, Conda cannot manage dependencies that pip has installed - it cannot upgrade them, or remove them. More importantly, conda will install a package even if its already been installed with pip! Try this test:

conda create -n testenv python=3
conda activate testenv
pip install numpy
conda install scipy

从第三个命令中您将看到conda将要重新安装NumPy,即使它已经与pip一起安装了.如果存在链接不同的C库或类似的库,则可能会导致问题.通常,只要有可能,请使用conda将软件包安装到conda环境中.

You will see from the third command that conda will want to re-install NumPy, even though it has already been installed with pip. This can cause problems if there are C libraries whose linking is different, or something like that. In general, whenever possible, use conda to install packages into conda environments.

这篇关于使用pip在anaconda上安装python包有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆