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

Time:01-02

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

enter image description here

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.

enter image description here

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

CodePudding user response:

pip install 'package-name'==2.1.0

You can use above command

CodePudding user response:

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.

  • Related