简体   繁体   中英

Very Basic Python 2.7.13 Trouble opening files in IDLE and python

took a break from programming and am trying to get an old program up and running. I previously wrote a program called 'NetsimGUI' that uses modules networkx and matplotlib. I could not figure out how to install them on a new computer (running Windows 10) and then realized I could barely do anything at all. In the Python command window after importing pip I have tried the following:

'python pip install networkx'

'pip install networkx'

'python NetsimGUI'

'python NetsimGUI.py'

'Python NetsimGUI.py'

'Python27 NetsimGUI.py'

'NetsimGUI.py'

'NetsimGUI'

'python -m pip install -U pip'

'python -v'

'py27 -v'

'py -27 -v'

'Python -v'

and so on. All give errors saying NameError: name 'python' or name 'py' is not defined or something similar. PATH environment variable is set to C:\\Python27 and NetsimGUI.py is in that folder as well. Guessing the solution is something super simple I am missing. Any ideas?

It looks like you're basically having trouble installing pip on Windows. What you're doing isn't exactly correct, the correctly way to install pip 2.7 on Windows is detailed here

From the docs:

To install pip, securely download get-pip.py .

Then run the following:

python get-pip.py

Once you've done that, you should be able to install python modules as normal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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