In this article I’ll explain how you can set-up your Windows 10 machine for some extreme Python development.
UPDATE: Here is a video version of the tutorial (updated to use the latest Python3 and Eclipse Neon).
Install Python
First we install Python. I recommend Python 2.7 because it has the most compatible packages. Visit www.python.org and navigate to Downloads > Windows and click Python 2.7.9.
Next, select Download Python 2.7.9 from options.
Wait for the Python installer to download, and then double click on it.
The Python Windows Installer will launch.
In the Python Setup screen, select Install for all users and click Next >.
I recommend you leave the destination directory as default and click Next >.
Leave the Customize Python 2.7.9 screen as default and select Next >.
Wait for the installation to complete.
Once the installation completes, choose Finish.
Now we need to add Python to the environment variables. This means when you type “python” into the Windows Command Prompt window, it will start Python. Right click the Start Menu in the bottom left and select System to load the System menu.
In the System menu, click on Advanced system settings.
In the System Properties window, select the Advanced tab and click Environment Variables…
Under System variables, find the variable with the name Path. Click it and choose Edit…
Being careful to leave the existing values intact, navigate to the end of the Variable value text box. Then append “;C:\Python27\” to the end (without quotes). The semicolon is used to separate the variables. Then click OK to save the update.
Then click OK on the Environment Variables screen.
Click OK on the System Properties screen.
Exit the System menu by clicking X.
Now left click the start menu again and choose Command Prompt to load a new Command Prompt window.
Now enter “python” into the window and hit Enter.
If you type print “hello world” it should output “Hello World” on the screen. Python has been successfully installed.
Install the Eclipse PyDev Plugin
Next we will install the Eclipse PyDev plugin. Launch Eclipse by double clicking on the eclipse executable.
Eclipse will launch.
Once Eclipse loads, select Help > Install New Software…
The Install menu will load. Next to the text box that says type or select a site, click on Add… to add a new repository.
In the Add Repository window, type the name PyDev, and enter the location as http://pydev.org/updates. Then click OK.
Now ensure that the PyDev repository is selected in the Work with menu. Check the box next to PyDev in the list and click Next >.
Review the Install Details screen and select Next >.
Have a fleet of lawyers review the license agreement and if they advise it’s safe, select I accept the license agreement. Then click Finish.
The Installing Software box will display the progress of the installation.
During the installation, you should be prompted if you trust the certificate. Check the box next to Branwy Software; PyDev; Brainwy and click OK.
After the installation completes you will be prompted to restart eclipse. Choose Yes.
Once Eclipse restarts, click on Window > Open Perspective > Other.
In the Open Perspective menu you should be able to find one called PyDev. Select it and click OK to open the PyDev perspective.
If the Welcome screen is still visible, you can close it by clicking the X.
PyDev is now installed and you can begin coding!
Did you install PyWin32 by any chance ?
I have read of several incidents where PyWin32 would not install or import win32api fails.
Hi Siew, No I didn’t install PyWin32….
I installed python 3.4.3 for win 10 following the steps. When i type print “hello world” it prints <>.
Try print (“Hello World”)
There have been some changes in the syntax for python 3.
I installed python 3.4.3 for win 10 following the steps. When i type print “hello world” it prints <>. saying syntax error: missing parenthesis in call to ‘print’
>>>
Hey, are you copying and pasting it from the page? It might be because sometimes the browser renders the quotes as a different character. It sounds really weird but there are a number of different types of quote. Try deleting the whole line and writing it again using single quotes instead of double quotes. Let us know if it works for you.
My guess would be that in Python 3 print can only be used as a function as in print(“hello world”).
Thanks!
print(“hello world”)
worked for me!
thank you sir
Thank you man. I was looking why I couldn’t run it in my pc.
You can skip all of those extra steps for adding Python to your environmental path by just enabling the option during install (the last option, which is X’d out in your screenshot).
Can’t you skip all of those extra steps for adding Python to your environmental path, just by turning on that option during install (the last option, which is X’d out in your screenshot)?
Hi Keven, thanks for the comment. Yes, absolutely you can. The reason I include it is because if someone is new to Python and forgets to check this, it can be a nightmare to figure out how to solve it. I’m hoping that with my tutorial detailing the steps including Python Path, it will give people a deeper understanding of what’s happening and prevent them from spending hours trying to figure out what’s going on 🙂
thank you very much that you wrote it step by step because i wasnt able to figure out why its not working on my laptop
i watched alot of videos and it wasnt working but when i came here and i did exactly what you did it worked and i was so happy thank you again ! 🙂
Hi,
In the command prompt when I type ‘python’ (quotes removed of course)
this message pops up:
‘python’ is not recognized as an internal or external command,
operable program or batch file.
is there any way to fix this?
Thank you in advance
Sounds like you need to do the “Add Python scripts directory to system path” part again.
Thanks a lot. Much appreciated!
Thank you!
Please give me a link to download Eclipse PyDev Plugin
Would it not be better to install a 64 bit version of python in windows 10?
For data plotting and using emacs in org-mode, which version of python: 3.4.3 or 2.7 (assuming that the required libraries are available in both).
You saved my life Thank you very much
This would have been a great article if only the author would realize that it is time to drop python 2 and offer full support of python3 — Get over it folks python 2 is dead.
Thanks for taking the time to comment. I totally agree with you! I wrote it using Python 2 because it’s what I was using at the time, as I was working on a big project that had some dependencies which were not ported to Python 3. On my new projects I use Python 3 and I plan to make a Python 3 version of this article soon!
Python 2 is dead when Python 3 is used more and has more supported libraries. That is not the case, even 8 months after you wrote this. Do some Python 3 development if you want it adopted. Currently there is just too much “legacy” code written in Python 2 for many people, seriously using Python, to switch to Python 3.
Thanks Man, good blog. Successfully installed python 2.7, Java SDK, Eclipse-Mars and Pydev all in about three hours!
Como puedo hacer para instalar Aptana Studio 3? Tengo Windows 10
hello,
I am totally new to python and install it for the first time. I am not tech savvy at all. Following your instructions, I have a problem at the step, where I have to append“;C:\Python27\” to the end of variable box. In the system variable box, my variable is looking very different from yours. It says ” Files (x86)\Skype\Phone\;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\” Instead of “system32\wbem\systemroot%……” Why this might be? Do I need to add an extra line for this?
Could you also explain why “Python27”, if I am install python 3.4.4, do I still append “\Python27”?
Thank you very much!
hello Yiming, I’ve just installed Python (2.7.12 thou) and am having the same issue adding the Path to it. My variable looks very similar to yours. Did you manage to sort it?
Thank you!
Hi Mark,
I am a newbee and I would like to have some additional help.
After I installed Python 2.7.11, all of a sudden you introduce PyDev for Eclipse. Now first of all, I can find ‘Eclipse’ (eclipse-inst-win64.exe) on the internet, but do not know which one to install (varying from ‘Eclipse IDE for JAVA Developers’ to ‘Eclipse for Scout Developers’??). Maybe after that it will become cleare, but still haven’t got a clou how to integrate/install this from your explanation.
Please, a little bit moer info on this,
Regards Gerard
Hello Gerard ,
it is the classic one 3.6.0
hope that would help you.
Hai
Hi Gerard,
Thanks for the comment. I agree, Eclipse is a bit confusing to get going. I typically use the “Eclipse IDE for Java EE Developers” version because I feel it is the most complete with existing plugins. However, technically it should not matter which version you choose to use, as installing PyDev should work on any. Unfortunately Eclipse doesn’t seem to have an official installing, so it’s just a case of manually downloading and unzipping the files to your “Program Files” directory (or wherever you want to store them).
Cheers,
Mark
Hi Mark,
Thanks for the info.
No, there is an installer ‘EclipseInstaller by Oomph’. I am using that one, but it gave me all the mentioned options.
Regards,
Gerard
Good job, everything worked out fine! Thanks for this tutorial.
Excellent
Used this to add python path to command prompt. Very clear. Thankyou
Great tutorial. Thank you 🙂
hey
it’s been good so far.
Thank you for your help.
but I can’t seem to find eclipse executable.
Is eclipse supposed to be pre- installed or do i need to install it from somewhere? also, if it needs to be installed could you please provide a link to the preferred version?
sorry if its supposed to be obvious, i am new here.
thanks a lot
I installed PyDev for Eclipse, but when I go to open perspective PyDev doesn’t show up. Any ideas?
Same thing for me.
Please don’t suggest Python 2.7.
Python 3.5 is far better and 95% of modules have been updated to 3.
I can’t seem to find eclipse executor
Did you download it for the correct platform?
After multiple install attempts of Python 34 or 35, with and without ‘As Administrator,’ I get following when attempting to start python from command prompt:
C:\Windows\System32>python
Fatal Python error: Py_Initialize: unable to load the file system codec
Traceback (most recent call last):
File “c:\Python35-32\lib\encodings\__init__.py”. line 31, in
zipimport.ZipImportError: can’t find module ‘codecs’
C:\Windows\System32>
I will now try Python 2 instructions to see if any different…
Hi Mike, did it work?
Hi Mark
I discovered a PYTHONHOME environment variable from a document camera install I had done many months ago. Merely removing that, since no longer using camera, corrected my problem and now Python 3.5.2 works perfectly. No other actions taken besides install instructions. Thanks for asking.
Hi
Mark i installed pythong 2.7.9 on my machine and have eclipse 4.22 classic. after intalling the pydev i still dont see pydev in other perspective window. nor do i see it windows/preferences window
please suggest
I have a program written in python 2.3, but it does not run in windows anymore. Windows 10 say that python 2.3 is not available. How can I get my program to run in windows 10?
Do you need to type in an administrator’s password?
Thank you so much!
Sorry please I thought I have installed properly python 27 but I can’t open it from my window powershell and I have installed notepad++ text editor as well any procedure on hw I can rectify this appending problem? Your candid opinion will be highly appreciated
Thanks! It was very clear to understand and much appreciated.
You are welcome!
I would like to know if python comes with text editor built in ?
Hi Mario, no it doesn’t. However, you can use any text editor. My favourite is https://atom.io/.
how to run a script i windows 10?
Hi Reveur, you simple run “python“… So for example, “python myscript.py”.
how can I run python 2.7.12 in Windows 10. Mine is not showing the option ‘run’
Failed with Python 2.7.x installation on Windows 10 machine for npm dependency
http://stackoverflow.com/questions/39939768/failed-with-python-2-7-x-installation-on-windows-10-machine-for-npm-dependency
Hello, thanks for the great article! I seem to have a problem which I cannot shake. In windows 10, I am taking all the steps you described, but when I reach the point where I have to “open perspective” in eclipse, I cannot seem to find the PyDev option. The Installation of New Software performs correctly and PyDev for Eclipse is showing in Installed Software, but does not show the perspective. Has anyone seen this before? Any suggestions? Thank you!
Thanks Mark – wish I’d seen this at 5am yesterday morning.
Have been struggling to install successfully using a couple of other (older) tutorials… all failed.
FINALLY have it installed after your great tute.
Thanks a tonne.
Dave
i finally got python installed as per your post, thanks for your guidance
The installation cannot be completed as requested
Hello Mark, it is Jean from France.
I have windows10 and Python3.6.1 (latest release).
I can’t read files content … I am getting crazy !!!
Python code :
from os import *
chdir(“C:/Users/jfdch/Desktop/User/Python.3.6.1/Essais”)
Fichier1 = open(“File”,O_RDONLY)
print(type(Fichier1))
Fichier1.read(2)
Python shell result : I have ‘int’ type for file instead of ‘_io.TextIOWrapper’
and of course the read() method does not work
=== RESTART: C:\Users\jfdch\Desktop\User\Python.3.6.1\Essais\fichiers1.py ===
Traceback (most recent call last):
File “C:\Users\jfdch\Desktop\User\Python.3.6.1\Essais\fichiers1.py”, line 6, in
Fichier1.read(2)
AttributeError: ‘int’ object has no attribute ‘read’
>>>
Hi,
I have installed Python in my windows 10 system and after that I tried to configure with eclipse, I followed all procedures what you mentioned above. Unfortunately after clicking install PyDev s/w …. it shows error as “Installing Software has encountered a problem”.
Can you help me how to fix this.
Mark – this code automatically came up when i started a new project
Default
python interpreter
Now, when i write any code after – and try to save the code, then it dosent save the code, please help!
Hi I found I needed to add not only Python27 but also the site packages n scripts as well:
C:\Python27;C:\Python27\Lib\site-packages\;C:\Python27\Scripts\
Thank you for this – without it I would have a nightmare setting Python up on Windows
One of the best tutorial/guide . The perfect use of screenshots and steps.
I had downloaded python 3.4.8 but I didn’t get ide
Thank you 🙂