Python 不会在 windows powershell 中运行 [英] Python will not run in windows powershell

查看:52
本文介绍了Python 不会在 windows powershell 中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让 python.exe 在 windows powershell 中以交互模式运行.我已将 c:\python27 添加到我的 PATH 中,当我在 shell 中键入python"时,会打开一个新的命令提示符窗口,运行 python,而不是在 powershell 中运行.这是一个问题,因为当我运行python --version"之类的东西时,它会启动新的命令提示符窗口,然后在我阅读它之前关闭.有谁知道如何让python在powershell中运行?

I am trying to get python.exe to run in interactive mode in windows powershell. I have added c:\python27 to my PATH and when I type "python" in into the shell a new command prompt window opens running python, rather than running within powershell. This is a problem as when I run things like "python --version" it launches the new command prompt window and then closes before I can read it. Does anyone know how to get python to run in powershell?

注意:在我今天早上开始安装 pip、easy_install 和 virtualenv 之前,这曾经工作过.

Note: this used to work before I started to install pip, easy_install and virtualenv this morning.

谢谢

推荐答案

我在差点拔掉头发后刚刚解决了这个问题.以为我会分享.在 windows 系统 > 高级系统设置 > 环境变量中有两个地方可以更改 PATH,用户变量和系统变量.我在两者中都添加了;c:\python27"作为 PATH 的值.现在可以使用了

I just solved this issue after nearly pulling my hair out. Thought I would share. In windows system > advanced system settings > environment variables there are two places to change the PATH, user variables and system variables. I added ";c:\python27" as the value for PATH in both. It now works

这篇关于Python 不会在 windows powershell 中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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