1
我正在尝试一个简单的应用程序。但是,我无法从VS.Code导入BS4。我试图卸载,重新安装,检查路径等我现在卡住了。有谁知道如何解决这个问题?请参阅屏幕截图:Visual Studio代码Python导入错误
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
PS C:\workarea\dev\test> & c:/APPS/Python35-32/python.exe c:/workarea/dev/test/bs4.py
Traceback (most recent call last):
File "c:/workarea/dev/test/bs4.py", line 5, in <module>
from bs4 import BeautifulSoup
File "c:\workarea\dev\test\bs4.py", line 5, in <module>
from bs4 import BeautifulSoup
ImportError: cannot import name 'BeautifulSoup'
PS C:\workarea\dev\test> & c:/APPS/Python35-32/python.exe c:/workarea/dev/test/hello.py
['c:\\workarea\\dev\\test', 'C:\\APPS\\Python35-32\\python35.zip', 'C:\\APPS\\Python35-32\\DLLs', 'C:\\APPS\\Pytho
n35-32\\lib', 'C:\\APPS\\Python35-32', 'C:\\APPS\\Python35-32\\lib\\site-packages']
如果在vscode终端内部首先执行'cd C:\ APPS \ Python35-32',然后尝试从python命令行导入文件,会发生什么? – ChatterOne
工作,如果我先cd到c:\ APPS \ Python35-32然后运行python它在里面工作vs命令行 –
您是否尝试设置您的PATH环境变量以包含python路径? – ChatterOne