5 ms·
A beginner's guide to setting up Python on Windows
- xradionut 14y agoThis isn't much better than what Zed Shaw's book has for instuctions. Consider some screen shots, using Enthoughts or Continuum disributions, etc...
- karamazov 14y agoAuthor 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 14y agoI'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 14y agoAnaconda 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...
- arthulia 14y agoDoesn't windows have a standard windows installer for python? Why are we still teaching beginners Python 2.7? What is wrong with python 3?
- traeblain 14y agoThey explain why at the end of the article. See: "A note on Python versions"
- tterrace 14y agoThere'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 14y agoI'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 https://pypi.python.org/pypi/pgmagick/0.5.5
- randuser 14y agoMost 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.
- moreati 14y agore PIL. It's "friendly fork"/successor pillow does support python 3.x https://pypi.python.org/pypi/Pillow/2.0.0 https://pypi.python.org/pypi/Pillow/2.0.0
- traeblain 14y agoI 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 14y agoPackage 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 14y agoThe 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.)
- akx 14y agoWill 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.
- cf 14y agoI found Anaconda (https://store.continuum.io/ 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.
- 3amOpsGuy 14y agoThe 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 14y agoETA - user site packages is a 2.6-onwards feature. Rtools: http://cran.r-project.org/bin/windows/Rtools/ http://cran.r-project.org/bin/windows/Rtools/
- obviouslygreen 14y agoI 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 14y agoIf 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.
- deleted 14y ago[deleted]
- obviouslygreen 14y agoI 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.
- camus 14y agoOr 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 14y agoWhile 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 14y agooh god i really need to test that QT stuff , sounds great !
- xradionut 14y agoStill use Linux as the host\development box and test the Windows version(s) in virtual machine(s). ;)
- abimaelmartell 14y agoinstall linux...
- imurray 14y agoI'm not a Windows user, but I'd probably suggest trying https://www.enthought.com/products/canopy/ 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 https://store.continuum.io/cshop/anaconda which I haven't tried to compare, but also looks promising.
- afterburner 14y agoSpyder's nice too, and free: http://code.google.com/p/spyderlib/ http://code.google.com/p/spyderlib/ I use it on both Windows and Linux.
- traeblain 14y agoSpyder has single-highhandedly allowed me to convert MATLAB users to Python.
- afterburner 14y agoExactly, I was one of those MATLAB users.
- ajhit406 14y agoGreat 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
- japaget 14y agoI 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/ 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.
- mepcotterell 14y agoIf 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.
- antihero 14y agoI 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 14y agoI 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.
- zodman 14y agofor me it is better run python behind cygwin, a linux guy on python feels more confortable
- dmoo 14y agoI usually kickoff with the ActiveState download on windows http://www.activestate.com/activepython/downloads http://www.activestate.com/activepython/downloads its a nice bundle with good help docs etc.