Python not found. cmd



我收到一条消息,说找不到Python。

这是我的代码的一部分

parser = OptionParser()
parser.add_option('-u', action="store")
parser.add_option('-d', action="store")
parser.add_option('-t', action="store")
options, args = parser.parse_args()
readerID = str(options.u)
docID = str(options.d)
task_selection = str(options.t)
if task_selection == '2a':
print("Countries of Visitors:")
for k,v in (Counter(program.ViewByCountry(docID,task_selection))).items():
print(k,"-->",v)
elif task_selection == '2b':
print("Continents of Visitors:")
for k,v in (Counter(program.ViewByCountry(docID,task_selection))).items():
print (k,"-->",v)

这是我的任务。

提供一个命令行界面来测试你的程序,如下所示:

% cw2 -u user_uuid -d doc_uuid -t task_id -f file_name

当我把这个放在我的命令行:

python3 cw2.py -d 140218233015-c848da298ed6d38b98e18a85731a83f4 -t 3a

我收到消息说Python找不到。我在Pycharm中创建了这个。为什么会发生这种情况?

您可能还没有将python添加到路径中。这个问题很可能是重复的,你可能想在稍后提出新问题之前搜索stackoverflow

首先按windows键并搜索python。

然后右键单击python并选择打开包含文件夹

从那里复制python.exe可执行的地址

将复制的地址添加到路径

要添加到路径,请执行以下操作:https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/

附言:我认为你不需要在命令末尾指定"3"(例如:python3(,这通常适用于windows上的linux用户,只需确保你有最新的版本和类型:

python *filename* [flags]

相关内容

最新更新