Install python module without admin rights

Most remote servers are governed by system admin rights. Python modules are abundantly available but cannot be installed in the default location without admin rights.

An alternative approach is to install the modules in the local home directory and point the python interpreter to access the modules placed in the local home directory.

Installation

Change directory into the source directory of the python module. Make sure the setup.py exists in the directory and execute the following command.

$ python setup.py install –home=/home/user/package_dir

At the shell command prompt, execute the following command

$ export PYTHONPATH=”${PYTHONPATH}:/home/user/package_dir/lib/python”

At the python Command Line Interpreter (CLI), test the following to confirm that the module has installed.

$ python

>>> import module_name

 

 

About these ads
Posted in Python

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: