导入错误:未找到模块名为openpyxl

0

的问题

我安装了openpyxl通过pip3但每当我试图进入我的剧本,我得到这个错误:

"python -u "/Users/hectorv/zipcodes/zips.py"
hectorv@Hectors-MacBook-Air zipcodes % python -u "/Users/hectorv/zipcodes/zips.py"
Traceback (most recent call last):
  File "/Users/hectorv/zipcodes/zips.py", line 1, in <module>
    import openpyxl
ImportError: No module named openpyxl"

当我试图安装,我再次得到这个:

hectorv@Hectors-MacBook-Air zipcodes % pip3 install openpyxl
Requirement already satisfied: openpyxl in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (3.0.9)
Requirement already satisfied: et-xmlfile in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from openpyxl) (1.1.0)
openpyxl python visual-studio-code
2021-11-24 00:28:15
1

最好的答案

1

你使用 Code Runner不是吗?

你可以避免使用 Code Runner. 之后你选择了正确的蟒蛇的口译,你可以点击 Run Python File 按钮,或右击和选择 Run Python File In Terminal 命令。

enter image description here

enter image description here

enter image description here

如果你坚持使用 Code Runner你可以添加 "code-runner.runInTerminal": true, 在设置。json文件。 这是因为如果你跑的 Code Runner 直接的 OUTPUT 小组,它将利用全球 python忽略python解释选择的蟒蛇扩展。

2021-11-24 02:19:06

是代码转轮的扩展问题谢谢你!
Hector

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................