No module named openpyxl - Python 3.6 - OSX

泄露秘密 提交于 2019-12-23 04:29:44

问题


I've installed openpyxl from the Terminal using

pip3 install openpyxl

without any problems. I've even double-checked by simply running import openpyxl from the Terminal window once Python is running, and it imports no problem.

The problem starts when I try and import openpyxl from a script I'm building to work with a spreadsheet. I'm using Sublime Text and can't even get past the import openpyxl at the beginning of the script without running into the following error:

Traceback (most recent call last): File "/Users/wcw/Desktop/test.py", line 1, in import openpyxl ImportError: No module named openpyxl

How can this be happening? I know I've installed openpyxl correctly from the Terminal window without any errors so how can my script not find the module?


回答1:


Try to do:

pip3 install --user openpyxl

Doing the --user worked for me when I tried to run my .py files with matplot lib modules which worked in 3.5 but not in 3.6.



来源:https://stackoverflow.com/questions/44223621/no-module-named-openpyxl-python-3-6-osx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!