What is the effect of using pip to install python packages on anaconda?(anaconda上使用pip安装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.
这篇关于anaconda上使用pip安装python包有什么效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:anaconda上使用pip安装python包有什么效果?
基础教程推荐
- 尝试制作WhatsApp机器人 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
