Anthony DeBarros – Setting up Python in Windows 10, python hosting.#Python #hosting

Posted on by 0 comment

Anthony DeBarros on data, product code

Installing Python under Windows 10 follows a similar script to installs under older versions of the operating system. In fact, this post follows closely on my previous entries about installing Python under Windows 7 and under Windows 8.1. The biggest difference here is that we re going to work with Python 3 instead of Python 2.

Ready? Here s your quick guide:

Set up Python on WindowsВ 10

1. Visit the official Python download page and grab the Windows installer for the latest version of Python 3. A couple of notes:

  • Python is currently available in two versions Python 2 and Python 3. For beginners, that can be confusing. In short, Python 3 is where the language is going; Python 2 has a large base of existing users but isn t developing beyond bug fixes. Read thisВ for more .
  • By default, the installer provides the 32-bit version. There s also a 64-bit version available. I ve generally stuck with 32-bit for compatibility issues with some older packages, but installing is so easy you can experiment with either.

2. Run the installer. You ll have two options choose Customize Installation.

3.В On the next screen, check all boxes under Optional Features. Click next.

That refers to an installation of 32-bit Python 3.5.

5. Next, set the system s PATH variable to include directories that include Python components and packages we ll add later. To do this:

  • Open the Control Panel (easy way: click in the Windows search on your task bar and type Control Panel then click the icon).
  • In the Control Panel, search for Environment; click Edit the System Environment Variables. Then click the Environment Variables button.
  • In the User Variables section, we will need to either edit an existing PATH variable or create one. If you are creating one, make PATH the variable name and add the following directories to the variable values section as shown, separated by a semicolon. If you re editing an existing PATH, the values are presented on separate lines in the edit dialog. Click New and add one directory per line.

6. Now, you can open a command prompt (Start MenuВ | Windows System | Command Prompt) and type:

That will load the Python interpreter:

Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win 32 Type help , copyright , credits or license for more information. gt; gt; gt;

Because of the settings you included in your PATH variable, you can now run this interpreter and, more important, a script from any directory on your system.

Type exit() and hit ReturnВ to exit the interpreter and get back to a C: prompt.

Optional: Set up useful Python packages

Python 3 comes with the package installer pip already in place, which makes it super easy to add useful packages to your Python installation. The syntax is this (replace some_package with a package name you want to install):

pip install some_package

1. Let s add a couple of must-have utilities for web scraping: Requests and BeautifulSoup. You can use pip to install them all with one command:

pip install beautifulsoup4 requests

2. csvkit, which I covered here, is a great tool for dealing with comma-delimited text files. Add it:

pip install csvkit

You re now set to get started using and learning Python under Windows 10. If you re looking for a guide, start with theВ Official Python tutorial.

Learn data analysis with SQL!

Related

69 responses to Setting up Python in Windows 10

During the install there is a checkbox that says Add Python 3.5 to PATH. Does this work rather than manually setting it in step 3 above?

To follow up, checking the box during the install seems to work, at least accessing Python through IDLE (I haven t tried anything else).

Thanks for the helpful instructions!

Thanks man, I am new to Windows 10 and this was really helpful!

Hallo, this has been very helpfull man. However, I got a problem with pip install some_package command an error that says could not find a version that satisfies the requirement any help please

Replace some_package with an actual package name, such as csvkit.

For me, the default install did not install it to C:\Python35, but to some deep AppData folder (C:\Users\Philbert\AppData\Local\Programs\Python to be exact)

This annoyed me, so I uninstalled it and went for the custom install. There you get the choice to set the install folder (so I set it to C:\Python35) and as mentioned above, to have the installer create the environment variables (path) for you.

Thanks for the heads-up on that. Looks like Python 3.5 s installer now offers that option, and I ve made a change to the instructions.

[ ] 3 donde se haya instalado. Para el caso de Windows 10 los pasos varГ­an un poco, sin embargoВ este enlaceВ muestra todos los pasos para esa [ ]

Thank you for sharing! I m new to python and window 10. I found the following steps confusing:

In the User Variables section, edit the PATH statement to add this (if there is no PATH variable, click NEW to create one):

Do I suppose to create three user variables with different names? I try to create a variable named PATH , however, when I move to the next directory with the same name, it just clear the previous information. So I m really confused about what I need to do. Could you provide a step by step instruction for this part? Thanks!

I clarified the instructions in the post. Windows 10 presents one dialog if you re creating a new PATH, and a different dialog if you re editing a PATH. (At least that s what I see on my system.)

Awesome Anthony. This is the best how to on installing Python that I have seen.


Category: News | Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *