如何使用 Anaconda Python 执行 .py 文件? [英] How to use Anaconda Python to execute a .py file?

查看:47
本文介绍了如何使用 Anaconda Python 执行 .py 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的 Windows 计算机上下载并安装了 Anaconda.但是,我在使用命令提示符执行 .py 文件时遇到问题.如何让我的计算机了解 python.exe 应用程序位于 Anaconda 文件夹中,以便它可以执行我的 .py 文件?

I just downloaded and installed Anaconda on my Windows computer. However, I am having trouble executing .py files using the command prompt. How can I get my computer to understand that the python.exe application is in the Anaconda folder so it can execute my .py files?

推荐答案

您应该使用 Anaconda Prompt 而不是常见的 Windows 命令提示符.然后导航到包含 .py 文件的文件夹并运行:

You should use Anaconda Prompt instead of common Windows command prompt. Then navigate to your folder with the .py file and run:

 python myfile.py

然而,如果你想使用普通的命令提示符,你应该把你的路径放在 python.exe 中,通常在

However if you want to use normal command prompt you should put the path with you're python.exe which is usually in

C:\Users\<username>\AppData\Local\Continuum\anaconda3\python.exe

在这个后面放你的 .py 文件.

behind this one put your .py file.

这篇关于如何使用 Anaconda Python 执行 .py 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆