0

I tried to install openpyxl through pip, got the below error. 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. 

1 Answer 1

1

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 
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. 'python -m ensurepip --upgrade'--user' worked for me.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.