简体   繁体   English

从Windows 7命令提示符运行.py时出错

[英]Error running .py from Windows 7 command prompt

I am new to python and I have just installed python 2.7.3 on Windows. 我是python的新手,我刚刚在Windows上安装了python 2.7.3。 I will also install django so I need to execute a file named ez_setup.py. 我还将安装django,因此需要执行一个名为ez_setup.py的文件。 I know it seems like an easy question and answer can be found in internet, but this is not the case. 我知道在互联网上似乎可以找到一个简单的问题和答案,但事实并非如此。 I tried lots of things and tried what internet says, the problem is still there and I cant find the problem! 我尝试了很多事情,并尝试了互联网所说的内容,问题仍然存在,我找不到问题!

I follow all the steps that is explained in tutorials in order for Python to work properly. 我按照教程中说明的所有步骤进行操作,以使Python正常工作。 (Installing steps and editing environment variables..) (安装步骤和编辑环境变量。)

Python's location is: Python的位置是:

C:\Users\name\27

Command prompt starts like: 命令提示符开始如下:

C:\Users\name>

I have put ez_setup.py file under both C:\\Users\\name\\27 and C:\\Users\\name. 我已经将ez_setup.py文件放在C:\\ Users \\ name \\ 27和C:\\ Users \\ name下。

When I type "ez_setup.py" or "python ez_setup.py" or "\\27 python ez_setup.py" and lot of combination, it says: 当我键入“ ez_setup.py”或“ python ez_setup.py”或“ \\ 27 python ez_setup.py”以及许多组合时,它会显示:

python: cant open file 'ez_setup.py': [Errno 2] No such file or directory.

What should I do? 我该怎么办? Where do I make mistake? 我在哪里犯错?

Just do: 做就是了:

python ez_setup.py

You need to say your machine that it should execute this .py file with python. 您需要说机器,它应该使用python执行此.py文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM