2016-05-30 53 views
0

我想在Windows XP上设置Python SimpleHTTPServer。我的电脑上安装了Python。我执行以下命令:在窗口上创建http服务器时出错

python -m SimpleHTTPServer 8888 

但我得到的错误:

python : The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

+0

您可能需要到Python添加到Windows PATH环境变量。如果从包含python.exe的目录运行相同的命令,它是否工作? – 101

回答

0

看起来像Python是不是在你的PATH环境变量。为了解决这个问题尝试这样的回答: https://stackoverflow.com/a/6318188/6400392

  1. Hold Win and press Pause.
  2. Click Advanced System Settings.
  3. Click Environment Variables.
  4. Append ;C:\python27 to the Path variable.
  5. Restart Command Prompt.