Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Installing modules on Windows

📅 2009-Oct-24 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

In my short experience with Python, I have found that there is more than one way to install a Python module on Windows and depending on the module you may need to know all the different tricks:

  1. Popular modules provide a .exe or .msi setup file. Just double click and it will find out your Python installation location and install its files in all the right locations.

  2. Most modules however ship as zipped up Python code. Unzip it, and if you see a setup.py file there, you can install it from the Windows command line using the incantation: python setup.py install

  3. Sometimes a module is just a single or few .py files. In this case put these files in your $(PYTHONPATH)/Lib directory and your Python code will be able to find them when you import the module.