Vam*_*oos 6 dll importerror python-3.x anaconda visual-studio-code
我已经安装了 Anaconda(及其附带的软件包)和 VS Code(从 Anaconda Navigator 中)。如果我从 Anaconda Navigator 或从 The Anaconda Prompt 打开 VS Code,一切import
正常。但是如果我直接打开 VS Code,它会抛出一个ImportError
.
例如:
from PIL import Image
Run Code Online (Sandbox Code Playgroud)
给出以下错误:
Traceback (most recent call last):
File "c:\MyPrograms\Coding\Scripts\imageOperations.py", line 7, in
<module>
from PIL import Image
File "C:\MyPrograms\Coding\Software\Python\lib\site-
packages\PIL\Image.py", line 93, in <module>
from . import _imaging as core
ImportError: DLL load failed: The specified module could not be found.
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
小智 5
- (类型)CTRL + SHIFT + P
- (搜索:)打开设置
- (点击:)首选项:打开设置(JSON)
然后添加三行配置:
{
... # any other settings you have already added (remove this line)
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"terminal.integrated.shellArgs.windows": ["/K", "C:\\Anaconda3\\Scripts\\activate.bat C:\\Anaconda3"],
"python.condaPath": "C:\\Anaconda3\\Scripts\\conda.exe"
}
Run Code Online (Sandbox Code Playgroud)
最后,重启你的 VScode
归档时间: |
|
查看次数: |
2486 次 |
最近记录: |