4

I want to install the matplotlib package for Python with pip install matplotlib in the command prompt but suddenly the lines get red and the next error appears:

ERROR: Command errored out with exit status 1: 'c:\users\pol\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Pol\\AppData\\Local\\Temp\\pip-install-v44y041t\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Pol\\AppData\\Local\\Temp\\pip-install-v44y041t\\matplotlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Pol\AppData\Local\Temp\pip-record-d5re6a86\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

I'm using Windows and my Python version is 3.8.0. I have already tried python -m pip install matplotlib but it doesn't work.

5
  • It seems a problem with pip. Try the following: pip install -U setuptools pip install -U wheel Commented Nov 12, 2019 at 8:36
  • This gives the following error ERROR: Could not find a version that satisfies the requirement install (from versions: none) ERROR: No matching distribution found for install Commented Nov 12, 2019 at 8:45
  • 1
    There are no wheels for matplotlib 3.1.1 on python 3.8. Unless you want to build matplotlib from source, use python 3.7 instead. Also see this. Commented Nov 12, 2019 at 12:18
  • 1
    @ ImportanceOfBeingErnest. I erased my post. I suspected you downvoted me, my recommendation was to solve a pip problem. There was no matplotlib mention. Commented Nov 12, 2019 at 13:21
  • Thanks @ImportanceOfBeingErnest, I changed to 3.7.5 and it did work this time. Commented Nov 12, 2019 at 17:59

3 Answers 3

4

Had the same problem. Came across a solution (which, as I understand, is quite recent):

python -m pip install -U matplotlib==3.2.0rc1

Explanation:

Since there are no wheels available, installing matplotlib 3.1.1 on python 3.8 requires to build it from source. This process may turn out to be a little cumbersome. So for anyone having problems with that, either

Install matplotlib 3.1.1 on python 3.7 Wait for matplotlib 3.2.0 to be released with the respective wheels for python 3.8

Also, someone pointed to wheels stored here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib

But I haven't tried those myself.

Source: https://github.com/matplotlib/matplotlib/issues/15041

Sign up to request clarification or add additional context in comments.

1 Comment

Followed your step, a very good explanation but getting the same error
0

pip install --pre -U scikit-learn this command is work for me I have found because this error come for the duplication of same libraries.

Comments

-1

Try running your command prompt with administrator privileges

If the problem further persists try reinstalling pip

1 Comment

This is not a problem with pip, It is a problem with Python 3.'o' version

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.