kms
kms

Reputation: 2024

pip and python packages missing after attempting to upgrade a package

I just realized that pip was somehow uninstalled and all my packages are missing. My Apps have stopped running on local environment.

I was attempting to upgrade pandas using pip3 and conda. I had the environment up and running fine until then.

Is there a way to recover installed packages or restore the environment?

When I run pip3 list, I get:

Package    Version
---------- -------
pip        10.0.1 
setuptools 39.0.1 

Upvotes: 0

Views: 1788

Answers (2)

Mechatronod
Mechatronod

Reputation: 11

It seems like, your Python (manually or by your IDE) has been updated. One who encounters this problem maybe give a chance to change the environment paths order. Search for the "environment variables" on Windows. And check if you have already installed two different Python version. If you have so; you may change your older Python version's order to an upper position of newly installed version. This may help, but as mentioned at the first answer, using virtual environment for further projects is the best-practice.

Upvotes: 0

Grekkq
Grekkq

Reputation: 766

Probably there isn't any easy way to restore the packages. You could inspect your console output because pip shows which packages are uninstalled and just install them again.

Good practice for next time is to store packages needed for each script in requirements.txt file and also separating environments so that each script has its own virtual environment with packages in required version. You can read more about venv here.

Upvotes: 1

Related Questions