如何解决为什么Visual Studio Code无法在Python2中运行松露?
我正在使用Visual Studio Code。 我已经在我的环境(主文件夹)中成功安装了松露:
PS D:\Software\repo\_VS_Code\tmep> npm install -g truffle
当我尝试松露菌时:
PS D:\Software\repo\_VS_Code\tmep> truffle init
出现以下错误:
Traceback (most recent call last):
File "c:\users\michelangiolo\appdata\local\programs\python\python38-32\lib\runpy.py",line 194,in _run_module_as_main
return _run_code(code,main_globals,None,File "c:\users\michelangiolo\appdata\local\programs\python\python38-32\lib\runpy.py",line 87,in _run_code
exec(code,run_globals)
File "C:\Users\Michelangiolo\AppData\Local\Programs\Python\Python38-32\Scripts\truffle.exe\__main__.py",line 4,in <module>
File "c:\users\michelangiolo\appdata\local\programs\python\python38-32\lib\site-packages\truffle\app.py",line 33
print file_index
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(file_index)?
但是,我已经选择了Python 2.7.15作为解释器,甚至对终端进行了双重检查:
PS D:\Software\repo\_VS_Code\tmep> python
Python 2.7.15 (v2.7.15:ca079a3ea3,Apr 30 2018,16:22:17) [MSC v.1500 32 bit (Intel)] on win32
Type "help","copyright","credits" or "license" for more information.
看来VS Code仍在尝试使用Python3运行松露,有解决方案吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。