17 авг. 2022 г.
читать 1 мин
Одна распространенная ошибка, с которой вы можете столкнуться при использовании Python:
no module named ' matplotlib '
Эта ошибка возникает, когда Python не обнаруживает библиотеку matplotlib в вашей текущей среде.
В этом руководстве представлены точные шаги, которые вы можете использовать для устранения этой ошибки.
Шаг 1: pip устанавливает matplotlib
Поскольку matplotlib не устанавливается автоматически вместе с Python, вам нужно будет установить его самостоятельно. Самый простой способ сделать это — использовать pip , менеджер пакетов для Python.
Вы можете запустить следующую команду pip для установки matplotlib:
pip install matplotlib
В большинстве случаев это исправит ошибку.
Шаг 2: Установите пип
Если вы все еще получаете сообщение об ошибке, вам может потребоваться установить pip. Используйте эти шаги , чтобы сделать это.
Вы также можете использовать эти шаги для обновления pip до последней версии, чтобы убедиться, что он работает.
Затем вы можете запустить ту же команду pip, что и раньше, чтобы установить matplotlib:
pip install matplotlib
На этом этапе ошибка должна быть устранена.
Шаг 3: проверьте версии matplotlib и pip
Если вы все еще сталкиваетесь с ошибками, возможно, вы используете другую версию matplotlib и pip.
Вы можете использовать следующие команды, чтобы проверить, совпадают ли ваши версии matplotlib и pip:
which python
python --version
which pip
Если две версии не совпадают, вам нужно либо установить более старую версию matplotlib, либо обновить версию Python.
Шаг 4: Проверьте версию matplotlib
После того, как вы успешно установили matplotlib, вы можете использовать следующую команду, чтобы отобразить версию matplotlib в вашей среде:
pip show matplotlib
Name: matplotlib
Version: 3.1.3
Summary: Python plotting package
Home-page: https://matplotlib.org
Author: John D. Hunter, Michael Droettboom
Author-email: matplotlib-users@python.org
License: PSF
Location: /srv/conda/envs/notebook/lib/python3.7/site-packages
Requires: cycler, numpy, kiwisolver, python-dateutil, pyparsing
Required-by: seaborn, scikit-image
Note: you may need to restart the kernel to use updated packages.
Примечание. Самый простой способ избежать ошибок с версиями matplotlib и Python — просто установить Anaconda , набор инструментов, предустановленный вместе с Python и matplotlib и бесплатный для использования.
Дополнительные ресурсы
В следующих руководствах объясняется, как исправить другие распространенные проблемы в Python:
Как исправить: нет модуля с именем numpy
Как исправить: нет модуля с именем plotly
Как исправить: имя NameError ‘pd’ не определено
Как исправить: имя NameError ‘np’ не определено
OS: Windows 10
Python ver: 3.9.0
Error code:
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I tried:
python -m pip install -U pip
python -m pip install -U matplotlib
didn’t work.
and then I tried:
pip install --upgrade setuptools
didn’t solve the problem.
I read on SO that maybe if I open the shell in administrator mode it could solve the problem but it didn’t work too.
I saw someone mentioning ez-setup for this error code. I installed it but that didn’t work too.
I don’t know if it has something to do but my C directory looks like this:
C:UsersMETİNUSTA
It has an uppercase i character which sometimes can cause problems with applications. I can’t change it because I am using my school’s Windows key and it don’t let me do any change. Because of this I installed python on D: .
Also here my pip list for extra information:
ez-setup 0.9
flake8 3.8.4
mccabe 0.6.1
pip 20.2.4
pycodestyle 2.6.0
pyflakes 2.2.0
setuptools 50.3.2
wheel 0.35.1
and finally whole error log that I get on windows powershell:
ERROR: Command errored out with exit status 1:
command: 'd:pythonpython39python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\METİNUSTA\AppData\Local\Temp\pip-install-8iv10tb_\matplotlib\setup.py'"'"'; __file__='"'"'C:\Users\METİNUSTA\AppData\Local\Temp\pip-install-8iv10tb_\matplotlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:UsersMETİNUSTAAppDataLocalTemppip-pip-egg-info-elosrn6m'
cwd: C:UsersMETİNUSTAAppDataLocalTemppip-install-8iv10tb_matplotlib
Complete output (99 lines):
WARNING: Missing build requirements in pyproject.toml for numpy>=1.15 from https://files.pythonhosted.org/packages/bf/e8/15aea783ea72e2d4e51e3ec365e8dc4a1a32c9e5eb3a6d695b0d58e67cdd/numpy-1.19.2.zip#sha256=0d310730e1e793527065ad7dde736197b705d0e4c9999775f212b03c44a8484c.
WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'setuptools>=40.8.0' and 'wheel'.
ERROR: Command errored out with exit status 1:
command: 'd:pythonpython39python.exe' 'd:pythonpython39libsite-packagespip_vendorpep517_in_process.py' prepare_metadata_for_build_wheel 'C:UsersMETNUS~1AppDataLocalTemptmpqz3brme_'
cwd: C:UsersMETİNUSTAAppDataLocalTemppip-wheel-l2wpf1i8numpy
Complete output (49 lines):
Error in sitecustomize; set PYTHONVERBOSE for traceback:
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xdd in position 0: unexpected end of data (sitecustomize.py, line 21)
Running from numpy source directory.
setup.py:470: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
Error in sitecustomize; set PYTHONVERBOSE for traceback:
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xdd in position 0: unexpected end of data (sitecustomize.py, line 21)
Processing numpy/random_bounded_integers.pxd.in
Processing numpy/randombit_generator.pyx
Traceback (most recent call last):
File "C:UsersMETİNUSTAAppDataLocalTemppip-wheel-l2wpf1i8numpytoolscythonize.py", line 59, in process_pyx
from Cython.Compiler.Version import version as cython_version
ModuleNotFoundError: No module named 'Cython'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:UsersMETİNUSTAAppDataLocalTemppip-wheel-l2wpf1i8numpytoolscythonize.py", line 235, in <module>
main()
File "C:UsersMETİNUSTAAppDataLocalTemppip-wheel-l2wpf1i8numpytoolscythonize.py", line 231, in main
find_process_files(root_dir)
File "C:UsersMETİNUSTAAppDataLocalTemppip-wheel-l2wpf1i8numpytoolscythonize.py", line 222, in find_process_files
process(root_dir, fromfile, tofile, function, hash_db)
File "C:UsersMETİNUSTAAppDataLocalTemppip-wheel-l2wpf1i8numpytoolscythonize.py", line 188, in process
processor_function(fromfile, tofile)
File "C:UsersMETİNUSTAAppDataLocalTemppip-wheel-l2wpf1i8numpytoolscythonize.py", line 64, in process_pyx
raise OSError('Cython needs to be installed in Python as a module')
OSError: Cython needs to be installed in Python as a module
Cythonizing sources
Traceback (most recent call last):
File "d:pythonpython39libsite-packagespip_vendorpep517_in_process.py", line 280, in <module>
main()
File "d:pythonpython39libsite-packagespip_vendorpep517_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "d:pythonpython39libsite-packagespip_vendorpep517_in_process.py", line 133, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "d:pythonpython39libsite-packagessetuptoolsbuild_meta.py", line 161, in prepare_metadata_for_build_wheel
self.run_setup()
File "d:pythonpython39libsite-packagessetuptoolsbuild_meta.py", line 253, in run_setup
super(_BuildMetaLegacyBackend,
File "d:pythonpython39libsite-packagessetuptoolsbuild_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 499, in <module>
setup_package()
File "setup.py", line 479, in setup_package
generate_cython()
File "setup.py", line 274, in generate_cython
raise RuntimeError("Running cythonize failed!")
RuntimeError: Running cythonize failed!
----------------------------------------
ERROR: Command errored out with exit status 1: 'd:pythonpython39python.exe' 'd:pythonpython39libsite-packagespip_vendorpep517_in_process.py' prepare_metadata_for_build_wheel 'C:UsersMETNUS~1AppDataLocalTemptmpqz3brme_' Check the logs for full command output.
Traceback (most recent call last):
File "d:pythonpython39libsite-packagessetuptoolsinstaller.py", line 126, in fetch_build_egg
subprocess.check_call(cmd)
File "d:pythonpython39libsubprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['d:\python\python39\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\Users\METNUS~1\AppData\Local\Temp\tmppoh8r2c9', '--quiet', 'numpy>=1.15']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:UsersMETİNUSTAAppDataLocalTemppip-install-8iv10tb_matplotlibsetup.py", line 242, in <module>
setup( # Finally, pass this all along to distutils to do the heavy lifting.
File "d:pythonpython39libsite-packagessetuptools__init__.py", line 152, in setup
_install_setup_requires(attrs)
File "d:pythonpython39libsite-packagessetuptools__init__.py", line 147, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "d:pythonpython39libsite-packagessetuptoolsdist.py", line 673, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "d:pythonpython39libsite-packagespkg_resources__init__.py", line 764, in resolve
dist = best[req.key] = env.best_match(
File "d:pythonpython39libsite-packagespkg_resources__init__.py", line 1049, in best_match
return self.obtain(req, installer)
File "d:pythonpython39libsite-packagespkg_resources__init__.py", line 1061, in obtain
return installer(requirement)
File "d:pythonpython39libsite-packagessetuptoolsdist.py", line 732, in fetch_build_egg
return fetch_build_egg(self, req)
File "d:pythonpython39libsite-packagessetuptoolsinstaller.py", line 128, in fetch_build_egg
raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['d:\python\python39\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\Users\METNUS~1\AppData\Local\Temp\tmppoh8r2c9', '--quiet', 'numpy>=1.15']' returned non-zero exit status 1.
Edit setup.cfg to change the build options; suppress output with --quiet.
BUILDING MATPLOTLIB
matplotlib: yes [3.3.2]
python: yes [3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC
v.1927 64 bit (AMD64)]]
platform: yes [win32]
sample_data: yes [installing]
tests: no [skipping due to configuration]
macosx: no [Mac OS-X only]
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I am currently practicing matplotlib. This is the first example I practice.
#!/usr/bin/python
import matplotlib.pyplot as plt
radius = [1.0, 2.0, 3.0, 4.0]
area = [3.14159, 12.56636, 28.27431, 50.26544]
plt.plot(radius, area)
plt.show()
When I run this script with python ./plot_test.py
, it shows plot correctly. However, I run it by itself, ./plot_test.py
, it throws the followings:
Traceback (most recent call last):
File "./plot_test.py", line 3, in <module>
import matplotlib.pyplot as plt
ImportError: No module named matplotlib.pyplot
Does python look for matplotlib in different locations?
The environment is:
- Mac OS X 10.8.4 64bit
- built-in python 2.7
numpy, scipy, matplotlib is installed with:
sudo port install py27-numpy py27-scipy py27-matplotlib
py27-ipython +notebook py27-pandas py27-sympy py27-nose
The error “ModuleNotFoundError: No module named matplotlib» is a common error experienced by data scientists when developing in Python. The error is likely an environment issue whereby the matplotlib package has not been installed correctly on your machine, thankfully there are a few simple steps to go through to troubleshoot the problem and find a solution.
Your error, whether in a Jupyter Notebook or in the terminal, probably looks like one of the following:
No module named 'matplotlib'
ModuleNotFoundError: No module named 'matplotlib'
In order to find the root cause of the problem we will go through the following potential fixes:
- Upgrade pip version
- Upgrade or install matplotlib package
- Check if you are activating the environment before running
- Create a fresh environment
- Upgrade or install Jupyer Notebook package
Are you installing packages using Conda or Pip package manager?
It is common for developers to use either Pip or Conda for their Python package management. It’s important to know what you are using before we continue with the fix.
If you have not explicitly installed and activated Conda, then you are almost definitely going to be using Pip. One sanity check is to run conda info
in your terminal, which if it returns anything likely means you are using Conda.
Upgrade or install pip for Python
First things first, let’s check to see if we have the up to date version of pip installed. We can do this by running:
pip install --upgrade pip
Upgrade or install matplotlib package via Conda or Pip
The most common reason for this error is that the matplotlib package is not installed in your environment or an outdated version is installed. So let’s update the package or install it if it’s missing.
For Conda:
# To install in the root environment
conda install matplotlib
# To install in a specific environment
conda install -n MY_ENV matplotlib
For Pip:
# To install in the root environment
python3 -m pip install -U matplotlib
# To install in a specific environment
source MY_ENV/bin/activate
python3 -m pip install -U matplotlib
Activate Conda or venv Python environment
It is highly recommended that you use isolated environments when developing in Python. Because of this, one common mistake developers make is that they don’t activate the correct environment before they run the Python script or Jupyter Notebook. So, let’s make sure you have your correct environment running.
For Conda:
conda activate MY_ENV
For virtual environments:
source MY_ENV/bin/activate
Create a new Conda or venv Python environment with matplotlib installed
During the development process, a developer will likely install and update many different packages in their Python environment, which can over time cause conflicts and errors.
Therefore, one way to solve the module error for matplotlib is to simply create a new environment with only the packages that you require, removing all of the bloatware that has built up over time. This will provide you with a fresh start and should get rid of problems that installing other packages may have caused.
For Conda:
# Create the new environment with the desired packages
conda create -n MY_ENV python=3.9 matplotlib
# Activate the new environment
conda activate MY_ENV
# Check to see if the packages you require are installed
conda list
For virtual environments:
# Navigate to your project directory
cd MY_PROJECT
# Create the new environment in this directory
python3 -m venv MY_ENV
# Activate the environment
source MY_ENV/bin/activate
# Install matplotlib
python3 -m pip install matplotlib
Upgrade Jupyter Notebook package in Conda or Pip
If you are working within a Jupyter Notebook and none of the above has worked for you, then it could be that your installation of Jupyter Notebooks is faulty in some way, so a reinstallation may be in order.
For Conda:
conda update jupyter
For Pip:
pip install -U jupyter
Best practices for managing Python packages and environments
Managing packages and environments in Python is notoriously problematic, but there are some best practices which should help you to avoid package the majority of problems in the future:
- Always use separate environments for your projects and avoid installing packages to your root environment
- Only install the packages you need for your project
- Pin your package versions in your project’s requirements file
- Make sure your package manager is kept up to date
References
Conda managing environments documentation
Python venv documentation
Bug report
Bug summary
Matplotlib installation through pip fails on Python 3.8.0b3 due to a problem with Visual C++. I was able to successfully install matplotlib on Python 3.7.4 without the bug.
Code for reproduction
Actual outcome
Using cached https://files.pythonhosted.org/packages/12/d1/7b12cd79c791348cb0c78ce6e7d16bd72992f13c9f1e8e43d2725a6d8adf/matplotlib-3.1.1.tar.gz
ERROR: Command errored out with exit status 1:
command: 'c:python38python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\*****\AppData\Local\Temp\pip-install-6rm6bopg\matplotlib\setup.py'"'"'; __file__='"'"'C:\Users\*****\AppData\Local\Temp\pip-install-6rm6bopg\matplotlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: C:Users*****AppDataLocalTemppip-install-6rm6bopgmatplotlib
Complete output (220 lines):
================================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [3.1.1]
python: yes [3.8.0b3 (tags/v3.8.0b3:4336222, Jul 29 2019, 16:54:03) [MSC
v.1916 64 bit (AMD64)]]
platform: yes [win32]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
tests: no [skipping due to configuration]
OPTIONAL BACKEND EXTENSIONS
agg: yes [installing]
tkagg: yes [installing; run-time loading from Python Tcl/Tk]
macosx: no [Mac OS-X only]
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
Could not locate executable g77
Could not locate executable f77
Could not locate executable ifort
Could not locate executable ifl
Could not locate executable f90
Could not locate executable DF
Could not locate executable efl
Using built-in specs.
COLLECT_GCC=C:Program Filesmingw-w64x86_64-8.1.0-posix-seh-rt_v6-rev0mingw64bingfortran.exe
COLLECT_LTO_WRAPPER=C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-8.1.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-posix-seh-rev0, Built by MinGW-W64 project' --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS=' -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/lib -L/c/mingw810/prerequisites/x86_64-zlib-static/lib -L/c/mingw810/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: posix
gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)
'svnversion' is not recognized as an internal or external command,
operable program or batch file.
Using built-in specs.
COLLECT_GCC=C:Program Filesmingw-w64x86_64-8.1.0-posix-seh-rt_v6-rev0mingw64bingfortran.exe
COLLECT_LTO_WRAPPER=C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-8.1.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-posix-seh-rev0, Built by MinGW-W64 project' --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS=' -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/lib -L/c/mingw810/prerequisites/x86_64-zlib-static/lib -L/c/mingw810/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: posix
gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)
Using built-in specs.
COLLECT_GCC=C:Program Filesmingw-w64x86_64-8.1.0-posix-seh-rt_v6-rev0mingw64bingfortran.exe
COLLECT_LTO_WRAPPER=C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/8.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-8.1.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw810/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-posix-seh-rev0, Built by MinGW-W64 project' --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS=' -I/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/include -I/c/mingw810/prerequisites/x86_64-zlib-static/include -I/c/mingw810/prerequisites/x86_64-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt/lib -L/c/mingw810/prerequisites/x86_64-zlib-static/lib -L/c/mingw810/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: posix
gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)
Running from numpy source directory.
C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0setup.py:418: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilssystem_info.py:690: UserWarning:
Optimized (vendor) Blas libraries are not found.
Falls back to netlib Blas library which has worse performance.
A better performance should be easily gained by switching
Blas library.
self.calc_info()
C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilssystem_info.py:690: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
self.calc_info()
C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilssystem_info.py:690: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
self.calc_info()
C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilssystem_info.py:1712: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
if getattr(self, '_calc_info_{}'.format(lapack))():
C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilssystem_info.py:1712: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
if getattr(self, '_calc_info_{}'.format(lapack))():
c:python38libdistutilsdist.py:274: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
Traceback (most recent call last):
File "c:python38libsite-packagessetuptoolsmsvc.py", line 489, in _find_latest_available_vc_ver
return self.find_available_vc_vers()[-1]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:python38libdistutilscore.py", line 148, in setup
dist.run_commands()
File "c:python38libdistutilsdist.py", line 966, in run_commands
self.run_command(cmd)
File "c:python38libdistutilsdist.py", line 985, in run_command
cmd_obj.run()
File "c:python38libsite-packagessetuptoolscommandbdist_egg.py", line 163, in run
self.run_command("egg_info")
File "c:python38libdistutilscmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:python38libdistutilsdist.py", line 985, in run_command
cmd_obj.run()
File "C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilscommandegg_info.py", line 26, in run
File "c:python38libdistutilscmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:python38libdistutilsdist.py", line 985, in run_command
cmd_obj.run()
File "C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilscommandbuild_src.py", line 142, in run
File "C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilscommandbuild_src.py", line 153, in build_sources
File "C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilscommandbuild_src.py", line 286, in build_library_sources
File "C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilscommandbuild_src.py", line 369, in generate_sources
File "numpycoresetup.py", line 667, in get_mathlib_info
File "c:python38libdistutilscommandconfig.py", line 241, in try_link
self._check_compiler()
File "C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilscommandconfig.py", line 54, in _check_compiler
File "c:python38libdistutils_msvccompiler.py", line 253, in initialize
vc_env = _get_vc_env(plat_spec)
File "c:python38libsite-packagessetuptoolsmsvc.py", line 185, in msvc14_get_vc_env
return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
File "c:python38libsite-packagessetuptoolsmsvc.py", line 843, in __init__
self.si = SystemInfo(self.ri, vc_ver)
File "c:python38libsite-packagessetuptoolsmsvc.py", line 485, in __init__
self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
File "c:python38libsite-packagessetuptoolsmsvc.py", line 492, in _find_latest_available_vc_ver
raise distutils.errors.DistutilsPlatformError(err)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:python38libsite-packagessetuptoolssandbox.py", line 154, in save_modules
yield saved
File "c:python38libsite-packagessetuptoolssandbox.py", line 195, in setup_context
yield
File "c:python38libsite-packagessetuptoolssandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "c:python38libsite-packagessetuptoolssandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0setup.py", line 443, in <module>
File "C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0setup.py", line 435, in setup_package
File "C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilscore.py", line 171, in setup
File "c:python38libsite-packagessetuptools__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:python38libdistutilscore.py", line 163, in setup
raise SystemExit("error: " + str(msg))
SystemExit: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:python38libsite-packagessetuptoolscommandeasy_install.py", line 1144, in run_setup
run_setup(setup_script, args)
File "c:python38libsite-packagessetuptoolssandbox.py", line 253, in run_setup
raise
File "c:python38libcontextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "c:python38libsite-packagessetuptoolssandbox.py", line 195, in setup_context
yield
File "c:python38libcontextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "c:python38libsite-packagessetuptoolssandbox.py", line 166, in save_modules
saved_exc.resume()
File "c:python38libsite-packagessetuptoolssandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "c:python38libsite-packagessetuptools_vendorsix.py", line 685, in reraise
raise value.with_traceback(tb)
File "c:python38libsite-packagessetuptoolssandbox.py", line 154, in save_modules
yield saved
File "c:python38libsite-packagessetuptoolssandbox.py", line 195, in setup_context
yield
File "c:python38libsite-packagessetuptoolssandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "c:python38libsite-packagessetuptoolssandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0setup.py", line 443, in <module>
File "C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0setup.py", line 435, in setup_package
File "C:Users*****AppDataLocalTempeasy_install-zkuhqlh3numpy-1.17.0numpydistutilscore.py", line 171, in setup
File "c:python38libsite-packagessetuptools__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:python38libdistutilscore.py", line 163, in setup
raise SystemExit("error: " + str(msg))
SystemExit: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:Users*****AppDataLocalTemppip-install-6rm6bopgmatplotlibsetup.py", line 262, in <module>
setup(
File "c:python38libsite-packagessetuptools__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "c:python38libsite-packagessetuptools__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "c:python38libsite-packagessetuptoolsdist.py", line 714, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "c:python38libsite-packagespkg_resources__init__.py", line 780, in resolve
dist = best[req.key] = env.best_match(
File "c:python38libsite-packagespkg_resources__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "c:python38libsite-packagespkg_resources__init__.py", line 1077, in obtain
return installer(requirement)
File "c:python38libsite-packagessetuptoolsdist.py", line 784, in fetch_build_egg
return cmd.easy_install(req)
File "c:python38libsite-packagessetuptoolscommandeasy_install.py", line 679, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "c:python38libsite-packagessetuptoolscommandeasy_install.py", line 705, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "c:python38libsite-packagessetuptoolscommandeasy_install.py", line 890, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "c:python38libsite-packagessetuptoolscommandeasy_install.py", line 1158, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "c:python38libsite-packagessetuptoolscommandeasy_install.py", line 1146, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
non-existing path in 'numpy\distutils': 'site.cfg'
non-existing path in 'numpy\random': 'src\splitmix64\splitmix.h'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Key line:
SystemExit: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
I installed Microsoft Visual C++ 14.22.27821, but the problem has persisted. Numpy installation fails similarly.
Expected outcome
Matplotlib is installed sucessfully.
Matplotlib version
- Operating system: Windows 10 Pro Insider Build 18956.rs_prerelease.190803-1414
- Matplotlib version: 3.1.1
- Matplotlib backend (
print(matplotlib.get_backend())
): N/A - Python version: 3.8.0b3 (tags/v3.8.0b3:4336222, Jul 29 2019, 16:54:03) [MSC v.1916 64 bit (AMD64)]
- Other libraries: pip 19.2.2