甜不辣933
2022-03-21 12:39
采纳率: 100%
浏览 65

安装python3.6和3.10后 运行 from sys import exit时 出现 “SyntaxError: invalid syntax” 问题

先安装的python3.6 后安装python3.10
下面这样的问题该怎么解决?请求答疑谢谢!

问题代码
PS C:\Users\asusa\lpthw> python ex35.py
File "C:\Users\asusa\lpthw\ex35.py", line 1
1 from sys import exit
^
SyntaxError: invalid syntax

安装的python3.10 和python 3.6
PS C:\Users\asusa\lpthw> python
Python 3.10.3 (tags/v3.10.3:a342a49, Mar 16 2022, 13:07:40) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

PS C:\Users\asusa\lpthw> py -3.6
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

3条回答 默认 最新

相关推荐 更多相似问题