About pip downloading different versions of packages for update

Hello everyone, I am [ Dried Beans and Peanuts ]. This time I have brought a new article to share with you~

About pip downloading different versions of packages for update


First update the current pip, because the next update needs to use the pip package

python -m pip install --upgrade pip

1. Uninstall first and then update

pip uninstall package

pip install pachage==版本号

pip upgrade package directly

pip install --upgrade 要升级的包名

2. Direct installation

Directly install the corresponding version of the package, the system will uninstall the old version first, and then install the new version

It is very convenient to cover directly!

pip install pachage==版本号

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple packagename==版本号
例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow==1.5.0

3. Conda creates a new environment

Because of the virtual environment provided by conda, each environment is isolated, and the isolation is very good, so there is no impact.

For the version of a large package, just create a new env directly

conda create -n envname python=3.4
conda list
activate envname
source activate envname#linux用这个
source deactivate envname

deactivate envname#linux use this to delete the environment
source deactivate envname
``

Note: Packages in different environments do not affect each other, neither pytorch nor cuda.

It’s not easy to code words. If you’ve seen this, why don’t you give a thumbs up~
I’m [ Dried Beans and Peanuts ]. Your likes + favorites + attention are the biggest motivation for me to persevere~

insert image description here

Dear friends, this is my new official account, welcome to pay attention!
The content of the official account includes but is not limited to artificial intelligence, image processing, signal processing , etc.~

More excellent blog posts will be released in the future, so stay tuned! Pay attention and let us grow together!
insert image description here

Guess you like

Origin blog.csdn.net/weixin_42784535/article/details/120205001