The build and install commands that you reference come from the setup.py file correctly?
Setup.py ( http://docs.python.org/2/distutils/setupscript.html )
This file is created by third-party Python applications / extensions. They are not part of:
- Python source code (a bunch of c files, etc.)
- Python libraries shipped with Python
When a developer creates a library for python that he wants to share with the world, he creates a setup.py file so that the library can be installed on any python machine. Maybe it's MISSING STEP
Setup.py sdist
This creates a python module (tar.gz files). This makes copying all files used by the python library to a folder. Creates a setup.py file for the module and archives everything so that the library can be built somewhere else.
Setup.py build
This returns the python module back to the library (ESPECIALLY FOR THIS OS).
As you know, the computer from which the python library originally belonged will be different from the library you are installing on.
- It may have a different version of python
- It may have a different operating system.
- It may have a different processor / motherboard / etc
For all the reasons listed above, the code will not work on another computer. Thus, setup.py sdist creates a module with only the source files needed to rebuild the library on another computer.
What setup.py does is exactly what the make file will do. It compiles sources / creates all libraries.
Now we have a copy of all the files that we need in the library, and they will work on our computer / operating system.
Install Setup.py
We have all the necessary files. But they will not work. What for? Well, they should be added to Python, why. Here is the installation. Now that we have a local copy of the library, we need to install it in python so that you can use it like this:
import mycustomlibrary
To do this, we need to do several things, including:
- Copy files to your library folders in our python version.
- Verify that the library can be imported using the
import command - Run any special installation instructions for this library. (setting paths, etc.)
This is the hardest part of the task. What if our library uses BeautifulSoup? This is not part of the Python library. We must install it so that our library and other users can use BeautifulSoup without interfering with each other.
So what if python was installed somewhere else? What if it was installed on a server with many users?
Set all these problems transparently. What it does is to make the library that we just created capable of working. All you have to do is use the import command, install all the others.