简体   繁体   English

openpyxl pip 安装失败

[英]openpyxl pip install failed

I tried to install openpyxl through pip, got the below error.我试图通过 pip 安装 openpyxl,得到以下错误。 How do I resolve this.我该如何解决这个问题。

C:\Users\User>python -m pip install --user openpyxl==3.0.3
Collecting openpyxl==3.0.3
  Using cached openpyxl-3.0.3.tar.gz (172 kB)
    ERROR: Command errored out with exit status 1:
     command: 'C:\Program Files\Python36\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-4ji7fq22\\openpyxl\\setup.py'"'"'; __file__='"'"'C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-4ji7fq22\\openpyxl\\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\User\AppData\Local\Temp\pip-install-4ji7fq22\openpyxl\pip-egg-info'
         cwd: C:\Users\User\AppData\Local\Temp\pip-install-4ji7fq22\openpyxl\
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\User\AppData\Roaming\Python\Python36\site-packages\setuptools\__init__.py", line 12, in <module>
        from setuptools.extension import Extension
      File "C:\Users\User\AppData\Roaming\Python\Python36\site-packages\setuptools\extension.py", line 7, in <module>
        from setuptools.dist import _get_unpatched
      File "C:\Users\User\AppData\Roaming\Python\Python36\site-packages\setuptools\dist.py", line 16, in <module>
        import pkg_resources
      File "C:\Users\User\AppData\Roaming\Python\Python36\site-packages\pkg_resources.py", line 1479, in <module>
        register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
    AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

It looks like the important part of this traceback is:看起来这个回溯的重要部分是:

AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'

Using this question , try:使用这个问题,尝试:

python3 -m ensurepip --upgrade

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM