0

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?

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

Thanks

2 Answers 2

6

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

Sign up to request clarification or add additional context in comments.

1 Comment

before I only had ;c:\python27 in user and not system variables.
0

I'm not expert in PS, but when I need to use python in interactive mode in windows powershell, I use something like this (version of python is 2.7.3, I didn't change env variables):

PS C:\Python27> ./python Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.

1 Comment

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.