Home > front end >  How do I prevent pip automatically installing supporting packages?
How do I prevent pip automatically installing supporting packages?

Time:05-12

I am using python 3.6.0 within a venv. I would like to "pip install" matplotlib==2.0.0, however when I do this, pip seems to automatically grab the newest versions of all other required supporting packages for matplotlib. i.e. cycler 0.11.0, pyparsing==3.0.7, etc. These latest supporting package versions do not seem to work with the older version of matplotlib and it throws errors when attempting to import matplotlib.

How do I install matplotlib without pip attempting to install all its supporting packages automatically?

My current temporary solution is to go back and manually install each package before installing matplotlib but I'm sure I will run into this issue again so would like to find a better solution.

CodePudding user response:

Pip has a built-in feature:

pip install matplotlib --no-dependencies

To exclude specific, you can put it in requirements file and pass it:

pip install --no-deps -r requirements.txt

  • Related