
A beginner's guide to setting up Python on Windows - karamazov
https://www.datanitro.com/blog/2013/4/11/Python_on_windows/
======
ajhit406
Great tutorial -- but this is exactly why we built Action.IO, so you don't
have to deal with these long posts. We have preconfigured Python boxes that
you can start coding on with your web browser, with full Linux terminal
access.

The unfortunate part of setting up Python on Windows, is that you're still
coding on Windows and missing out on using and learning powerful Linux/Unix
tools. Most servers operate using Linux, so having the same environment in
development is a huge advantage.

If you need an invite, just signup and send us an email at hello at action dot
io

~~~
traeblain
Last I checked, I could only setup a Ruby box. Where do we setup a python box?

~~~
ajhit406
We added Python, NodeJS and Go boxes last month. Just click "New Box" on the
box index page after you sign in and you can choose a box template.

------
japaget
I prefer to install the 64-bit Python 2.7.4, then use the pre-built packages
for Win64 at <http://www.lfd.uci.edu/~gohlke/pythonlibs/> . I primarily use
Python for scientific calculations, plus a little bit of web development, and
I have chosen the following packages: Base, NumPy, SciPy, MySQL-Python,
Mathplotlib. (NOTE: "Base" is a bundled collection of Python packages you will
find at the above site; it is not a package that you will find at the official
PyPI repository.) I also installed pip, but since I am behind a corporate
firewall and have another program named "pip" (part of Strawberry Perl), it
was a bit tricky.

------
traeblain
I also have to disagree with quite a bit of this guide. Most windows systems
are configured to simply do a `pip install numpy` since they often are missing
the specific compiling tools to properly install these packages. For Windows
vets, we've probably all seen the "Unable to find vcvarsall.bat" at one point
or another.

I've found the easiest way it to point to 3rd party installers that often
already have the key c-based tools you'll most often use. PythonXY, WinPython,
PortablePython or Continuum's Anaconda. But you have to take the "bloat" with
many of these, although PythonXY and WinPython allow you to select what you
want and don't want.

~~~
karamazov
Package managers are great until you want something that isn't provided. I
used numpy as an example, but our users are just as likely to work with web
scraping, SQL, or REDIS as with numerical computations; in that case, they
still need to know how to manage packages themselves.

~~~
traeblain
The installers don't stop the user from learning how to manage their packages.
Other than Anaconda, the installers still emphasis using easy_install or pip.
But what these do that many people don't understand is that when you do hit a
compiling problem, it's often easier to find a pre-compiled package and simply
install. So for you other examples, lxml is another notoriously difficult to
get running on Windows. So you are stuck with a less efficient BeautifulSoup
or not able to use PyQuery. So an installer for young python users is a
godsend. As they dig deeper into python, the items you highlight are naturally
developed.

(Don't get me wrong, by the way, props for helping out the often less
technical Windows crowd.)

------
imurray
I'm not a Windows user, but I'd probably suggest trying
<https://www.enthought.com/products/canopy/> (formerly the enthought python
distribution EPD) for a relatively hassle-free setup with numpy and other
scientific packages. It also works on linux and mac, but I usually go with
repository versions on linux.

Other comments suggest <https://store.continuum.io/cshop/anaconda> which I
haven't tried to compare, but also looks promising.

~~~
afterburner
Spyder's nice too, and free:

<http://code.google.com/p/spyderlib/>

I use it on both Windows and Linux.

~~~
traeblain
Spyder has single-highhandedly allowed me to convert MATLAB users to Python.

~~~
afterburner
Exactly, I was one of those MATLAB users.

------
arthulia
Doesn't windows have a standard windows installer for python? Why are we still
teaching beginners Python 2.7? What is wrong with python 3?

~~~
tterrace
There's still many popular libraries that haven't been ported over. Django has
recently been taken off the list but PIL, paramiko (and by extension, fabric)
and other libraries that a beginner might see mentioned on python tutorials
are still not ready. I recently gave python 3 another try and had to switch
back to 2.7 pretty quickly.

~~~
jlarocco
I'm starting to think that if a library won't switch to Python 3 then it's
time for the library to die and people move on to a new library that offers
similar functionality and does work on Python 3.

For example, PIL doesn't support Python 3, but there's a GraphicsMagick
wrapper [1] which does. Graphics Magick is more functional anyway.

You may have time invested in PIL and other Python 2 libraries, but newbies
don't, and there's no reason to start them off on a dying version of the
language. It's contributing to the chicken and egg problem that's holding
Python back.

[1] <https://pypi.python.org/pypi/pgmagick/0.5.5>

~~~
randuser
Most widely-used libraries have not actually switched to Python 3, they just
support it using 2to3.

Someone who only knows Python 3 would have a hard time hacking on the source
code of most libraries.

------
cf
I found Anaconda (<https://store.continuum.io/>) to be the easiest way to get
people setup with Python on nearly any system. It has the added benefit of
bundling ipython, pip and numpy which is notoriously a huge pain to get
working on Windows and Mac OS X.

------
mepcotterell
If you're in a position where you need to follow a guide to install Python on
Windows, then you're probably so new to Python that you're unlikely to be
working with legacy code. Therefore, I'd suggest working with Python 3 and
using 64-bit.

------
3amOpsGuy
The R guys do a really easy to use package of mingw for satisfying compiler /
linker requirements youll find you need (and all the other bits and bobs
required).

Another thing worth mentioning is "user site packages" directory for those on
locked down corporate machines. Pip install --user <package> will pop the
package in %UserProfile%\Python\Python2X\site-packages\ - which is
automatically on your $PYTHONPATH saving a little setup hassle.

~~~
3amOpsGuy
ETA - user site packages is a 2.6-onwards feature. Rtools:
<http://cran.r-project.org/bin/windows/Rtools/>

------
akx
Will numpy actually cleanly install with `pip` or `easy_install` on a system
that doesn't have the proper version of Visual Studio? If so, that's news to
me.

~~~
traeblain
No you have to have the correct version of VS or Mingw with the proper
commands in the way `pip` is configured.

------
xradionut
This isn't much better than what Zed Shaw's book has for instuctions. Consider
some screen shots, using Enthoughts or Continuum disributions, etc...

~~~
karamazov
Author here. I've pointed people to his book for a while, but they tend to
come back with questions. I'm hoping this'll help.

~~~
traeblain
I'd recommend pointing beginners to PythonXY, WinPython, PortablePython, or
Anaconda. Just like many Mac people get pointed to `brew` installs, it's just
easier for Windows users to run with these installers.

~~~
xradionut
Anaconda is a great install, especially for those dealing with data analysis,
but the conda upgrade process from one version to another (1.3 to 1.4) has
been hit or miss under Windows. But I still love the packaging and such they
and others do...

------
antihero
I really don't understand why you'd use Windows for Python development unless
you need to regularly use Creative Suite, mostly use Visual Studio/.NET and
just do Python on the side, or for some reason play AAA games while you are
working.

~~~
traeblain
I do all the time, mainly because of lock-in at work and family laptop. Python
is really easy to do this with. But yes, web code gets deployed to a Linux
box.

But you can do quite a bit from desktop application to the source of this
post, DataNitro (Use Python in Excel).

> mostly use Visual Studio/.NET and just do Python on the side

I have nothing to back myself up, but I would be surprised if this is actually
the case (ie most Windows users program with VS/.NET). I'd like to find out if
there is any real data on this.

------
dmoo
I usually kickoff with the ActiveState download on windows
<http://www.activestate.com/activepython/downloads> its a nice bundle with
good help docs etc.

------
zodman
for me it is better run python behind cygwin, a linux guy on python feels more
confortable

------
abimaelmartell
install linux...

------
camus
Or better , fire a virtual machine with linux. I used to develop python and
php on windows only to get loads of problems as soon as i had to deploy my
script on a linux server. Having a dev and test environment that is close to
the production server will save you a lot of time. Working on linux is a great
experience, and makes a difference when looking for a job.

Whatever os you choose you just cant get wrong learning python , it is so
awesome.

~~~
jlarocco
While it's definitely useful for production, test, and dev to all match, it's
pretty easy to write Python that runs everywhere. In my experience the Python
community is a lot better than most at making libraries and extensions work
across platform.

I've written GUI apps with PyQT where I developed them on Linux and had them
run without change on both Windows and OSX. Similarly, I've done some web
development on my Mac, deployed to a Linux server, and everything's worked.

On the other hand, IMO, developing on Linux is far easier and faster than
developing on Windows, so there may be other benefits to using a VM.

~~~
camus
oh god i really need to test that QT stuff , sounds great !

------
obviouslygreen
I understand that a lot of people prefer and/or are stuck with Windows, but
people who can't or won't move beyond that just are not likely to get much
utility out of Python.

If you're looking to learn it for any actual, practical application, e.g. any
kind of development that will be deployed on the web or any kind of native
system scripting, spending time setting it up on Windows is a waste of time
you will need to spend at some point anyway learning to use an operating
system that's actually suitable for such a purpose.

It's good that Windows users have the option of installing Python, I suppose,
but something like this seems aimed at people who either are not actually
going to do anything with or learn anything from it or are likely to simply
give up after hitting the quirks and limitations of the platform.

A far more useful article that would accomplish the same purpose more
effectively would be on setting up a free virtualization environment in
Windows, then pointing people to the normal doc on using Python in some flavor
of Linux.

~~~
jmduke
_If you're looking to learn it for any actual, practical application, e.g. any
kind of development that will be deployed on the web_

My first Python program was automating .csv creation based off of a bunch of
arbitrary files in a folder. I did it as a marketing intern, after spending an
hour convincing my boss that I could save the company literally tens of hours
of time a month. I did it on a Windows XP box.

A few months later, I changed my major to CS.

If we want more people programming -- and being good at it -- saying 'hey use
Linux lol' is not the way to go about it. _Especially_ in a corporate
environment.

~~~
obviouslygreen
I did not say "hey use Linux lol." I'm not one of those people. I made a
considered argument for learning Linux for people who actually want to get the
most out of Python, so the very least you can do is not lump me in with
chatspeakers.

Also, your assertion that we (whoever that is) "want more people programming"
is not one that I accept.

