Installing a python package / tool by a non root user

(1) I need to install one python package (HTSeq), but I do not have root privileges.

The package requires python 2.4 or latest version. Our cluster has python 2.3.

So I installed python 2.7 in my local directory using

./configure --prefix=/home/amit/tools/localpython make make install 

(2) The package also requires numpy: so I also installed it in my local directory using:

 /home/amit/tools/localpython/bin/python2.7 setup.py install --home=/home/amit/tools/localnumpy 

and done

 >>> sys.path.append("/home/amit/tools/localnumpy/lib/") 

(3) I downloaded the HTSeq tar file (which I want to download) and ran

 /home/amit/tools/localpython/bin/python2.7 setup.py install --home=/home/amit/tools/localhtseq 

he throws the following error:

 Could not import 'setuptools', falling back to 'distutils'. Setup script for HTSeq: Failed to import 'numpy'. Please install numpy and then try again to install HTSeq. 

Please give me some hint on how to overcome this.

Thanks in advance

+6
source share
2 answers

Setuptools is another requirement that must be installed for this package.

One option is to use virtualenv to create a contained python environment. This can be done everywhere and belongs to the user who creates it.

To install virtualenv without administrator privileges (from this answer ):

Download tar.gz from the latest version of virtualenv. Unzip it. You don't even need to install it, just run virtualenv.py, for example:

 wget http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.7.1.2.tar.gz tar -xzf virtualenv-1.7.1.2.tar.gz /home/amit/tools/localpython/bin/python2.7 virtualenv-1.7.1.2/virtualenv.py env env/bin/pip install HTSeq env/bin/pip install numpy 

Now run your script using python binary in a virtual environment:

 env/bin/python myscript.py 
+7
source

1) You must install setuptools (you need to run setup.py of your HTSeq).

Download the tar.gz files setuptools-0.6c11.tar.gz , unzip it, and then follow the steps as you installed python2.7, but in the folder where you unpacked the setuptools source files:

 ./configure --prefix=/home/amit/tools/localpython make make install 

2) When you install setuptools, the easy_install executable will appear in the python2.7/scripts/ folder. You can easily use it to install packages:

 /home/amit/tools/localpython/bin/python2.7/scripts/easy_install HTSeq 

it will automatically find the package and download and install it for you along with all the dependencies.

+2
source

Source: https://habr.com/ru/post/914624/


All Articles