Installing Modules Python Tutorial



Up until this point, you have been able to follow along without actually needing your own installation of Python. In order to follow this tutorial, you're going to need your very own Python installation. Getting Python is easy enough, follow the video above.


At this point, you've got all the basics necessary to start employing modules.

We still have to teach classes, among a few other necessary basics, but now would be a good time to talk about modules.

If you are using linux, installing Python modules is incredibly easy. For programming, linux is just lovely when it comes to installing packages for just about whatever. I believe mac allows similar treatment, though I've not done it myself.

When I was first starting out with Python, installing modules was one of the most difficult things, for a few reasons. Mainly, with windows, there are quite a few methods for installation of modules. you've got pip install setuptools, download and click'n'drag, or setup.py

At the time of starting Python, a large part of my troubles was that I didn't actually understand the process of getting a module, and this is obviously very frustrating.

Python is going to look in a few places for modules.

That's going to be site-packages and the script's directory for the most part. There are some other places you can use, but let's leave them out of it. Knowing this allows you yourself to make your own modules, in the form of just a script if you want, putting that in the same directory as your main script, and then using import to bring it on board, you can also place multiple scripts in a dir and use that. Once you begin to familiarize yourself with this, and understand how and why things work, it will help you a lot.

As of Jan 23rd 2015, I would suggest using Pip to install modules, which is covered in the next tutorial. I decided to leave this tutorial in the lists, however, as sometimes modules still wont come compatible for pip uses, or maybe you have some sort of very unique version of Python that doesn't have pip functionality.

The next tutorial:





  • Python Introduction
  • Print Function and Strings
  • Math with Python
  • Variables Python Tutorial
  • While Loop Python Tutorial
  • For Loop Python Tutorial
  • If Statement Python Tutorial
  • If Else Python Tutorial
  • If Elif Else Python Tutorial
  • Functions Python Tutorial
  • Function Parameters Python Tutorial
  • Function Parameter Defaults Python Tutorial
  • Global and Local Variables Python Tutorial
  • Installing Modules Python Tutorial
  • How to download and install Python Packages and Modules with Pip
  • Common Errors Python Tutorial
  • Writing to a File Python Tutorial
  • Appending Files Python Tutorial
  • Reading from Files Python Tutorial
  • Classes Python Tutorial
  • Frequently asked Questions Python Tutorial
  • Getting User Input Python Tutorial
  • Statistics Module Python Tutorial
  • Module import Syntax Python Tutorial
  • Making your own Modules Python Tutorial
  • Python Lists vs Tuples
  • List Manipulation Python Tutorial
  • Multi-dimensional lists Python Tutorial
  • Reading CSV files in Python
  • Try and Except Error handling Python Tutorial
  • Multi-Line printing Python Tutorial
  • Python dictionaries
  • Built in functions Python Tutorial
  • OS Module Python Tutorial
  • SYS module Python Tutorial
  • Python urllib tutorial for Accessing the Internet
  • Regular Expressions with re Python Tutorial
  • How to Parse a Website with regex and urllib Python Tutorial
  • Tkinter intro
  • Tkinter buttons
  • Tkinter event handling
  • Tkinter menu bar
  • Tkinter images, text, and conclusion
  • Threading module
  • CX_Freeze Python Tutorial
  • The Subprocess Module Python Tutorial
  • Matplotlib Crash Course Python Tutorial
  • Python ftplib Tutorial
  • Sockets with Python Intro
  • Simple Port Scanner with Sockets
  • Threaded Port Scanner
  • Binding and Listening with Sockets
  • Client Server System with Sockets
  • Python 2to3 for Converting Python 2 scripts to Python 3
  • Python Pickle Module for saving Objects by serialization
  • Eval Module with Python Tutorial
  • Exec with Python Tutorial