What is the most complete way to install python on Windows?

I know that this question can be interpreted as a discussion, so I made it with the word "complete" rather than "better".

I'm a python user on GNU / Linux and here it comes more or less preinstalled. Still, I can use pip to install or remove new packages, creating a complete installation for my everyday use(virtualenv, scientific computing packages and other development libraries, like tkinter).

I've seen many python questions on Windows (in SOEN there are many, some begin to appear here in SOPT), and I know that there is a version of python (both 2.7 and 3.x) for installation from the website of the language itself, as well as some packages for Scientific Computing.

I imagine the answer will depend on my application. Considering two distinct environments:

  • Scientific Computing (in this case, which of the two applications listed in the link above is the most complete?)

  • Business development environment (here, I have no idea)

What kind of tools are there for MS Windows that allow me to have a good python development environment, simply, quickly and completely?

And yet, is there something equivalent to pip for Windows?

Author: Maniero, 2013-12-31

5 answers

One of the biggest difficulties in installing Python packages on Windows is that not always the resources required to compile them from the sources are present. This causes problems when installing certain packages via PIP, so some manual intervention ends up being required.

From my personal experience (Python 2.7 on Windows XP), the steps for setting up a Python environment would be:

  1. install Python itself, from your site official ;
  2. install the setuptools , from a binary own for Windows ;
  3. install the Pip , from a binary own for Windows ;
  4. place the folder where the pip is (e.g. C:\Python27\Scripts) in PATH (optional);
  5. for each package you want to install:
    1. try to install by Pip: pip install pacote.
    2. if the installation fails, look for a Windows-own binary in the Google.

Unfortunately, from my personal experience I can say that this step 5.2 is more frequent than I would like... "Pure python" packages like Django usually install well through pip, but those that require a native interface (usually via C) often fail frequently.

As for finding binaries, in general I simply search on Google, but on this site has a very extensive list of binaries both for Windows 32bits as for 64bits. Some of the packages I needed for commercial development (e.g. ReportLab - PDF generation, psycopg2 - interface with Postgres, mod-wsgi - interface with Apache, etc.) as well as some of scientific computing (NumPy, SciPy, PyEphem etc.) and many others are available in this list.

 17
Author: mgibsonbr, 2016-06-02 12:59:39

I advise you to study a little about Vagrant or some tool that will be able to provision several isolated environments of your operating system.

You may well work on windows and your desktop may be provisioned by an ubuntu, for example.

Www.vagrantup.com

Www.docker.io

 6
Author: Vinicius Souza, 2014-01-03 14:09:06

I came to quote the anaconda.

Anaconda is a completely free Python distribution (including for commercial use and redistribution). It includes over 195 of the most popular Python packages for science, math, engineering, data analysis.

This distribution comes with Spyder IDE, which resembles the MATLAB interface.

Python versions available: 2.7 and 3.4

 2
Author: João Paulo, 2015-06-25 10:43:51

In the main implementation of the Python language, CPython, also known as "reference implementation", the interpreter is written in... guess what?! C.

CPython is also famous for allowing easy access to C libraries, either when there is a need for performance optimizations, or serving as a "glue" language between low-level libraries.

And then the community uses this feature a lot... missed performance? Go down to C, and get on with life. It is so with PIL, PyCrypto, simplejson, to name a few. Fantastic!

Who programs in an environment where gcc is available becomes easy, there is no inconvenience. But those who need to use Windows suffer a bit, because CPython on this platform is officially compiled in MS Visual Studio.

When installing a package that has C code, the installation process will automatically try to find a compiler. If you don't have a compiler set up, you get an error that looks like this:

Error

Unable to find vcvarsall.bat

The solution is or get a binary version of the package (with an executable installer you simply click Next, Next, Finish!), or set up a compiler on your machine.

If you intend to develop in Python, I strongly recommend having a compiler installed . The options in Windows are: Visual Studio or MinGW. As a compiler, the pip itself takes care of requesting the build from the sources, it is much easier than searching for binary*.

I have a post about installing Python on Windows and setting up a compiler: http://fernandomacedo.com/programacao/instalando-python-no-windows

  • some projects work hard to compile because they rely on other libraries that need to be in the environment, but are not the majority, and you can always resort to a binary distribution if pip doesn't work.
 1
Author: Fernando Macedo, 2015-05-05 13:56:43

I would like to mention Chocolatey , a package manager for windows offering an experience similar to that of package managers on linux, installing it is simple just copy the command below and run it in CMD

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

After that just use the command choco search python in the CMD or Powershell to list the available packages. As well as choco install python to install python version 3 with the basic utilities.

 0
Author: Jose Paulo, 2019-06-04 20:27:49