Using pip is easy. Even on Windows!

I'm a Linux user, and the procedure for installing Python packages there is well-defined:

  • You use your system's package manager (apt-get, yum, pacman, whatever) to install Python and pip.
  • If a Python package you need is provided by that package manager, you should most likely install it from there.
  • But what if it's not?
    • Many people think using sudo to install a package using pip or even setup.py as root will do.
    • But I think that littering your system like that is not very nice (and running arbitrary setup.py as root is very dangerous), so I just install stuff to my user directory using pip install --user.

Today, however, I wanted to introduce Python to my friend who uses Windows, and show how nice it is by example. So I needed to install flask right away. I prepared for the worst. But it turns out that Python 3.4 and PEP 453 make it very easy!


Basically, pip is now included with Python 3.4 and later.

I tried to use the command pip on Windows, but it doesn't work just like that. Anyway, all my friend needed to do is install Python and run py -m pip install flask (that's how I think the included pip should be used).

And, of course, he was surprised by how easy it is to install the stuff, and how simply I tackled the task he needed to do (and almost resorted to PHP) with Python.

Created
Comments powered by Disqus