Python,安装matplotlib时出错

Python,安装matplotlib时出错,python,matplotlib,pip,Python,Matplotlib,Pip,操作系统:Windows 10 Python版本:3.9.0 错误代码: ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. 我试过: python -m pip install -U pip python -m pip install -U matplotlib 没用 然后我试着: pip install --upgr

操作系统:Windows 10

Python版本:3.9.0

错误代码:

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. 
我试过:

python -m pip install -U pip
python -m pip install -U matplotlib
没用

然后我试着:

pip install --upgrade setuptools
没有解决问题

我继续读下去,也许如果我在管理员模式下打开shell,它可以解决这个问题,但它不起作用

我看到有人提到这个错误代码的ez设置。我安装了它,但也不起作用

我不知道它是否有什么关系,但我的C目录如下所示:

C:\Users\METİNUSTA
它有一个大写的i字符,有时会导致应用程序出现问题。我无法更改它,因为我正在使用学校的Windows密钥,它不允许我做任何更改。因此,我在D:上安装了python

另请参见我的pip列表以获取更多信息:

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
最后是我在windows powershell上获得的整个错误日志:

    ERROR: Command errored out with exit status 1:
     command: 'd:\python\python39\python.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('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\METİNUSTA\AppData\Local\Temp\pip-pip-egg-info-elosrn6m'
         cwd: C:\Users\METİNUSTA\AppData\Local\Temp\pip-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:\python\python39\python.exe' 'd:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\METNUS~1\AppData\Local\Temp\tmpqz3brme_'
             cwd: C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy
        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/random\bit_generator.pyx
        Traceback (most recent call last):
          File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.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:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 235, in <module>
            main()
          File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 231, in main
            find_process_files(root_dir)
          File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 222, in find_process_files
            process(root_dir, fromfile, tofile, function, hash_db)
          File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py", line 188, in process
            processor_function(fromfile, tofile)
          File "C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.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:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
            main()
          File "d:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "d:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 133, in prepare_metadata_for_build_wheel
            return hook(metadata_directory, config_settings)
          File "d:\python\python39\lib\site-packages\setuptools\build_meta.py", line 161, in prepare_metadata_for_build_wheel
            self.run_setup()
          File "d:\python\python39\lib\site-packages\setuptools\build_meta.py", line 253, in run_setup
            super(_BuildMetaLegacyBackend,
          File "d:\python\python39\lib\site-packages\setuptools\build_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:\python\python39\python.exe' 'd:\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\METNUS~1\AppData\Local\Temp\tmpqz3brme_' Check the logs for full command output.
    Traceback (most recent call last):
      File "d:\python\python39\lib\site-packages\setuptools\installer.py", line 126, in fetch_build_egg
        subprocess.check_call(cmd)
      File "d:\python\python39\lib\subprocess.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:\Users\METİNUSTA\AppData\Local\Temp\pip-install-8iv10tb_\matplotlib\setup.py", line 242, in <module>
        setup(  # Finally, pass this all along to distutils to do the heavy lifting.
      File "d:\python\python39\lib\site-packages\setuptools\__init__.py", line 152, in setup
        _install_setup_requires(attrs)
      File "d:\python\python39\lib\site-packages\setuptools\__init__.py", line 147, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "d:\python\python39\lib\site-packages\setuptools\dist.py", line 673, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "d:\python\python39\lib\site-packages\pkg_resources\__init__.py", line 764, in resolve
        dist = best[req.key] = env.best_match(
      File "d:\python\python39\lib\site-packages\pkg_resources\__init__.py", line 1049, in best_match
        return self.obtain(req, installer)
      File "d:\python\python39\lib\site-packages\pkg_resources\__init__.py", line 1061, in obtain
        return installer(requirement)
      File "d:\python\python39\lib\site-packages\setuptools\dist.py", line 732, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "d:\python\python39\lib\site-packages\setuptools\installer.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.
错误:命令出错,退出状态为1:
命令:“d:\python\python39\python.exe'-c”import sys,setuptools,tokenize;sys.argv[0]=“C:\\Users\\METİNUSTA\\AppData\\Local\\Temp\\pip-install-8iv10tb\\\matplotlib\\setup.py”“”__文件“C:\\Users\\METİNUSTA\\AppData\\Local\\Temp\\pip-install-8iv10tb\\matplotlib\\setup.py”;f=getattr(标记化,“'open'”,open)(\uuuuu文件);code=f.read().replace(“\r\n”“”、“\n”“”);f、 close();exec(编译(代码,“'exec'”)“鸡蛋信息——鸡蛋库”C:\Users\METİNUSTA\AppData\Local\Temp\pip-pip-egg-info-elosrn6m”
cwd:C:\Users\METİNUSTA\AppData\Local\Temp\pip-install-8iv10tb\uu\matplotlib\
完整输出(99行):
警告:在pyproject.toml中缺少来自的numpy>=1.15的生成要求https://files.pythonhosted.org/packages/bf/e8/15aea783ea72e2d4e51e3ec365e8dc4a1a32c9e5eb3a6d695b0d58e67cdd/numpy-1.19.2.zip#sha256=0d310730e1e793527065ad7dde736197b705d0e4c9999775f212b03c44a8484c.
警告:项目未指定生成后端,如果没有“setuptools>=40.8.0”和“wheel”,pip将无法退回到setuptools。
错误:命令出错,退出状态为1:
命令:“d:\python\python39\python.exe”d:\python\python39\lib\site packages\pip\\u vendor\pep517\\u in_process.py“为构建轮准备元数据”C:\Users\METNUS~1\AppData\Local\Temp\tmpqz3brme”
cwd:C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy
完整输出(49行):
站点自定义错误;为回溯设置PYTHONVERBOSE:
SyntaxError:(unicode错误)'utf-8'编解码器无法解码位置0中的字节0xdd:数据意外结束(sitecustomize.py,第21行)
从numpy源目录运行。
setup.py:470:UserWarning:无法识别的setuptools命令,继续生成Cython源并展开模板
运行\u build=parse\u setuppy\u命令()
站点自定义错误;为回溯设置PYTHONVERBOSE:
SyntaxError:(unicode错误)'utf-8'编解码器无法解码位置0中的字节0xdd:数据意外结束(sitecustomize.py,第21行)
处理numpy/random\\ u bounded\ u integers.pxd.in
处理numpy/random\bit\u generator.pyx
回溯(最近一次呼叫最后一次):
文件“C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py”,第59行,进程中
从Cython.Compiler.Version导入版本为Cython\u版本
ModuleNotFoundError:没有名为“Cython”的模块
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py”,第235行,在
main()
文件“C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py”,主目录第231行
查找进程文件(根目录)
文件“C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py”,第222行,位于find_process_文件中
进程(根目录、fromfile、tofile、函数、散列数据库)
文件“C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py”,第188行,正在处理中
处理器函数(fromfile,tofile)
文件“C:\Users\METİNUSTA\AppData\Local\Temp\pip-wheel-l2wpf1i8\numpy\tools\cythonize.py”,第64行,进程中
raise OSError('Cython需要作为模块安装在Python中')
OSError:Cython需要作为一个模块安装在Python中
环化源
回溯(最近一次呼叫最后一次):
文件“d:\python\python39\lib\site packages\pip\\u vendor\pep517\\u in_process.py”,第280行,在
main()
文件“d:\python\python39\lib\site packages\pip\\u vendor\pep517\\u in_process.py”,第263行,在main中
json_out['return_val']=hook(**hook_输入['kwargs'])
文件“d:\python\python39\lib\site packages\pip\\u vendor\pep517\\u in_process.py”,第133行,位于为构建程序准备元数据中
返回钩子(元数据目录、配置设置)
文件“d:\python\python39\lib\site packages\setuptools\build\u meta.py”,第161行,位于为构建车轮准备元数据中
self.run_setup()
文件“d:\python\python39\lib\site packages\setuptools\build\u meta.py”,第253行,在run\u安装程序中
超级(_BuildMetaLegacyBackend,
文件“d:\python\python39\lib\site packages\setuptools\build\u meta.py”,第145行,在run\u安装程序中
exec(编译(代码、文件、exec)、局部变量()
文件“setup.py”,第499行,在
安装程序包()
文件“setup.py”,第479行,在setup\u包中
生成_cython()
文件“setup.py”,第274行,在generate_cython中
引发运行时错误(“运行cythonize失败!”)
运行时错误:运行cythonize失败!
----------------------------------------
错误:命令出错,退出状态为1:'d:\python\python39\python.exe''d:\python\python39\lib\site packages\
git clone git://github.com/matplotlib/matplotlib.git
cd matplotlib
python -mpip install .
python -mpip install -e .