在 Windows 8 上安装 Python 2.7 [英] Installing Python 2.7 on Windows 8

查看:24
本文介绍了在 Windows 8 上安装 Python 2.7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在我的 Windows 上尝试使用 python 2.7.它运行的是 Windows 8.我无法将它添加到我的路径中.我已经做了通常的:使用高级系统设置,环境变量,在系统变量中添加C:Python27.

So I'm trying python 2.7 on my Windows. It is running Windows 8. I cannot add it to my path. I've done the usual: using the advanced system settings, environment variables, adding C:Python27 in system variables.

但是,当我在命令提示符下键入 Python 时,它显示无法识别 python .."

However, when I type Python in command prompt it says 'python is not recognized ..'

推荐答案

我认为这个问题的本质是如何安装 Python 并能够从命令行使用它.下面的步骤展示了如何让所有这些工作正常进行.检查您是否没有遗漏任何内容:

I think that the essence of this question is how to install Python and be able to use it from the command line. The steps below show how to get all that working. Check that you didn't miss anything:

  1. https://www.python.org/download/releases/2.7.6 下载适当的 Python 2.7.6 Windows 安装程序.(如果该链接无效,请查看 https://www.python.org/downloads/)
  2. 运行文件
  3. 选择为所有用户安装或只为我安装,点击下一步
  4. 你会看到它安装在 C:Python27 文件夹下,点击下一步
  5. 再次单击自定义 Python"步骤的下一步
  6. 点击完成
  7. 打开控制面板,然后打开系统
  8. 点击左侧的高级系统设置"
  9. 点击环境变量"按钮
  10. 在系统变量"下单击名为路径"的变量,然后单击编辑..."按钮.(这将为所有用户设置它,您可以改为选择编辑用户变量以将 python 设置为当前用户的命令提示符命令)
  11. 在不删除任何其他文本的情况下,将 C:Python27;(包括分号)添加到变量值"的开头,然后单击确定".
  12. 在环境变量"窗口中单击确定".
  1. From https://www.python.org/download/releases/2.7.6 download appropriate Python 2.7.6 Windows Installer. (If that link doesn't work, check https://www.python.org/downloads/)
  2. Run the file
  3. Select install for all users or install just for me, click Next
  4. You'll see it installs under the C:Python27 folder, click Next
  5. Click Next again for the 'Customize Python' step
  6. Click Finish
  7. Open Control Panel, then System
  8. Click 'Advanced system settings' on the left
  9. Click the 'Environment Variables' button
  10. Under 'System variables' click the variable called 'Path' then the 'Edit...' button. (This will set it for all users, you could instead choose to edit the User variables to just set python as a command prompt command for the current user)
  11. Without deleting any other text, add C:Python27; (include the semi-colon) to the beginning of the 'Variable value' and click OK.
  12. Click OK on the 'Environment Variables' window.

打开一个新的命令提示符窗口类型python,你将在命令提示符下运行python.注意:在设置环境变量之前打开的命令提示符窗口将无法使用 python 命令.

Open a new command prompt window type python, you will have python running in the command prompt. Note: command prompt windows open prior to setting the Environment Variable will not have the python command available.

这篇关于在 Windows 8 上安装 Python 2.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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