Quando digito no IDLE, import openpyxl, aparece a seguinte mensagem de erro:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import openpyxl
ModuleNotFoundError: No module named 'openpyxl'
Procurei na internet como resolver isto, no terminal digitei:
sudo pip3 install openpyxl
Apareceu:
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)
Depois me falaram que deveria digitar na linha de comando:
sudo pip3 -H install openpyxl
Mas o erro na hora de importar openpyxl continua ocorrendo.
Ambiente:
- OS -Sierra - 10.12.6
- Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)
sudo -H pip3 install openpyxl
. Eu acho que digitarsudo pip3 -H install openpyxl
vai enviar o "-H" para o pip3 e não para o sudo.