Python, installing python modules from source. Slackware 14.2

1.1k Views Asked by At

I'm new to Slackware and to Python in general. When I'm trying to install a Python module from its source via command

python setup.py build
python setup.py install

It only creates a .egg file in /usr/lib64/python2.7/site-packages location, but not a directory with content of Python module.

I'm asking that because my task is to install Python modules from source without internet connection, so I can't use tools like easy_install or pip to automatically download and install needed python module.

So how do I properly install a Python module from source on Slackware 14.2 OS?

1

There are 1 best solutions below

0
On

The easiest way is to look for an uninstallable package. Slackware has a number of python libraries as .txz file and you should be able to download them and install them via the normal package manager.

But if there is no Slackware package for you specific python module, do, on a system that has Internet access:

mkdir moduledir
pip download <modulename> -d moduledir
tar cvf module.tar moduledir

scp, sftp (if you can) or ftp(if you must) or perhaps even use an usb stick to transfer module.tar to the machine without Internet access, and there:

tar xvfz module.tar
cd module
pip install <modulename> -f ./ --no-index