1
When I type in IDLE, import openpyxl, the following error message appears:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import openpyxl
ModuleNotFoundError: No module named 'openpyxl'
I looked on the Internet how to solve this, I typed in the terminal:
sudo pip3 install openpyxl
Appeared:
MBP-de-Edson:~ edson$ sudo pip3 install openpyxl
Password:
The directory '/Users/edson/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/edson/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: openpyxl in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Requirement already satisfied: jdcal in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from openpyxl)
Requirement already satisfied: et_xmlfile in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from openpyxl)
Then they told me I should type in the command line:
sudo pip3 -H install openpyxl
But the error when importing openpyxl continues to occur.
Ambience:
- OS -Sierra - 10.12.6
- Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)
Consider using the anaconda and end your package management problems.
– Sidon
When he tells you to use the "-H" option of sudo it seems to me he means
sudo -H pip3 install openpyxl
. I think typingsudo pip3 -H install openpyxl
will send the "-H" to pip3 and not to sudo.– Pagotti
installed openpyxl in python 2.7 standart(default) and not in version 3. You are using some virtual environment.. or just installed python and wants you to install it in the version you want to use ?
– stack.cardoso