Python에서 matplotlib 설치 문제 [중복]
Oct 10 2020
Python 3.9를 사용하여 Windows x64에 matplotlib를 설치하려고합니다. 내가 할 때 :
pip 설치 matplotlib
이 오류가 발생합니다.
ERROR: Command errored out with exit status 1:
command: 'c:\program files\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Luca\\AppData\\Local\\Temp\\pip-install-zlfu5f08\\kiwisolver\\setup.py'"'"'; __file__='"'"'C:\\Users\\Luca\\AppData\\Local\\Temp\\pip-install-zlfu5f08\\kiwisolver\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Luca\AppData\Local\Temp\pip-pip-egg-info-mriih1bh'
cwd: C:\Users\Luca\AppData\Local\Temp\pip-install-zlfu5f08\kiwisolver\
Complete output (44 lines):
WARNING: The wheel package is not available.
ERROR: Command errored out with exit status 1:
command: 'c:\program files\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Luca\\AppData\\Local\\Temp\\pip-wheel-pvxhkv11\\cppy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Luca\\AppData\\Local\\Temp\\pip-wheel-pvxhkv11\\cppy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Luca\AppData\Local\Temp\pip-wheel-1s8s6o5r'
cwd: C:\Users\Luca\AppData\Local\Temp\pip-wheel-pvxhkv11\cppy\
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
ERROR: Failed building wheel for cppy
ERROR: Failed to build one or more wheels
Traceback (most recent call last):
File "c:\program files\python39\lib\site-packages\setuptools\installer.py", line 128, in fetch_build_egg
subprocess.check_call(cmd)
File "c:\program files\python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['c:\\program files\\python39\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\Luca\\AppData\\Local\\Temp\\tmpggz7lusd', '--quiet', 'cppy>=1.1.0']' 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:\Users\Luca\AppData\Local\Temp\pip-install-zlfu5f08\kiwisolver\setup.py", line 59, in <module>
setup(
File "c:\program files\python39\lib\site-packages\setuptools\__init__.py", line 164, in setup
_install_setup_requires(attrs)
File "c:\program files\python39\lib\site-packages\setuptools\__init__.py", line 159, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "c:\program files\python39\lib\site-packages\setuptools\dist.py", line 699, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "c:\program files\python39\lib\site-packages\pkg_resources\__init__.py", line 779, in resolve
dist = best[req.key] = env.best_match(
File "c:\program files\python39\lib\site-packages\pkg_resources\__init__.py", line 1064, in best_match
return self.obtain(req, installer)
File "c:\program files\python39\lib\site-packages\pkg_resources\__init__.py", line 1076, in obtain
return installer(requirement)
File "c:\program files\python39\lib\site-packages\setuptools\dist.py", line 758, in fetch_build_egg
return fetch_build_egg(self, req)
File "c:\program files\python39\lib\site-packages\setuptools\installer.py", line 130, in fetch_build_egg
raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['c:\\program files\\python39\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\Luca\\AppData\\Local\\Temp\\tmpggz7lusd', '--quiet', 'cppy>=1.1.0']' returned non-zero exit status 1.
----------------------------------------ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
여기에서 찾은 모든 조언을 따르려고 노력했지만 계속해서 오류가 발생합니다.
누가 도와 줄까요?
답변
2 user14426357 Oct 10 2020 at 21:30
그런 다음 wheel을 설치 한 후 'pip install matplotlib'를 다시 실행해야합니다.
제 경우에는 오류가 베개 설치로 바뀌고 베개를 성공적으로 설치 한 후 마침내 matplotlib도 설치할 수 있습니다!
1 Aldysyahdeini Oct 10 2020 at 01:27
시험
pip install wheel
그런 다음 다시 시도하십시오.
1 PaddyPopeye Oct 10 2020 at 01:53
스택 트레이스에서 바퀴가 설치되지 않은 것처럼 보입니다.
다음을 시도하십시오
pip install wheel
그런 다음 실행
python setup.py bdist_wheel
문서 PIP 휠에 따라
Build System Interface¶
In order for pip to build a wheel, setup.py
must implement the bdist_wheel command with the following syntax:
python setup.py bdist_wheel -d TARGET
This command must create a wheel compatible with the
invoking Python interpreter, and save that wheel in the
directory TARGET.
No other build system commands are invoked by the pip wheel command.
BasG Oct 23 2020 at 20:47
나는 같은 오류가 있었다. 실행 후 플래그를 사용 pip install wheel하여 설치를 실행했습니다 --prefer-binary.
python -m pip install -U matplotlib --prefer-binary.
설명서는 다음과 같습니다.
이 명령으로 인해 소스에서 Matplotlib가 컴파일되고 컴파일에 문제가있는 경우 --prefer-binary를 추가하여 OS 및 Python 용으로 미리 컴파일 된 휠이있는 최신 버전의 Matplotlib를 선택할 수 있습니다.