Peter Fan
Peter Fan

Reputation: 93

No module named 'openpyxl' - Python 3.8.2

I execute pip install openpyxl, but I still get 'No module named 'openpyxl' in jupyter notebook.

C:\Users\PeterFan>pip install openpyxl
Requirement already satisfied: openpyxl in c:\python38\lib\site-packages (3.0.5)
Requirement already satisfied: et-xmlfile in c:\python38\lib\site-packages (from openpyxl) (1.0.1)
Requirement already satisfied: jdcal in c:\python38\lib\site-packages (from openpyxl) (1.4.1)

C:\Users\PeterFan>python --version
Python 3.8.2

import openpyxl

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-16-f5ea1cbb6934> in <module>
----> 1 import openpyxl

ModuleNotFoundError: No module named 'openpyxl'

Upvotes: 1

Views: 17344

Answers (1)

Peter Fan
Peter Fan

Reputation: 93

Thank you for your kind responses. I have resolved my question.

I installed multiple python versions(python 3.7.4, and python 3.8.2). I tried to pip uninstall selenium, import selenium in my notebook, and it still worked. Thus, I checked the document in the path C:\Python38\Lib\site-packages and there was no selenium package, but it exists in C:\Python37\Lib\site-packages.

I uninstalled python 3.8.2, deleting the environment variables pertaining to python 3.8.2., proceeding pip3 install openpyxl, the library was successfully installed and could be imported in my notebook.

Upvotes: 2

Related Questions