简体   繁体   中英

How do I change a python package version in just a specific environment?

I initially have pandas==1.5 both in my base environment, and in a specific environment

在此处输入图像描述

For a project's purpose, I had to downgrade my pandas version in my project environment to version 1.4. However, when I downgraded the pandas version in that environment, the version in my base environment got downgraded as well.

在此处输入图像描述

Why is this so, and how can I keep my package version downgrade to just a specific environment?

Can you try to installing your packages through Conda rather than pip since you're activating your environment through Conda itself.

conda install pandas=1.4.4

Remove the existing package and keep the latest one as you had earlier in both base and inside your environment. Then try to downgrade through conda.

You could read up more here , on using pip inside conda environment.

pip install 'package-name'==2.1.0

You can use above command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM