How can we install python modules without root access?

0 votes
I want to run my computationally intensive Numpy, matplotlib, scipy code on that machine, but I cannot install these modules because I am not a system administrator.

How can I do the installation?
Apr 14 in Python by kartik
• 26,540 points
248 views

1 answer to this question.

0 votes

Hii,

You can run easy_install to install python packages in your home directory even without root access. There's a standard way to do this using site.USER_BASE which defaults to something like $HOME/.local or $HOME/Library/Python/2.7/bin and is included by default on the PYTHONPATH

To do this, create a .pydistutils.cfg in your home directory:

cat > $HOME/.pydistutils.cfg <<EOF
[install]
user=1
EOF

Now you can run easy_install without root privileges:

easy_install boto

Alternatively, this also lets you run pip without root access:

pip install boto

This works for me.

Thank You!!

answered Apr 14 by Niroj
• 57,260 points

Related Questions In Python

0 votes
1 answer

How can we install python in RHEL using CLI?

Run the following command: sudo yum install python3 This ...READ MORE

answered Jun 23 in Python by Tanay Singh
36 views
0 votes
1 answer

How can I get a list of locally installed Python modules?

Solution My 50 cents for getting a pip freeze-like ...READ MORE

answered May 23, 2018 in Python by charlie_brown
• 7,780 points
355 views
0 votes
2 answers

How can I install external binaries using portable python

0110100001000101001010101001011010100100111100101001 READ MORE

answered Jan 24, 2019 in Python by anonymous
521 views
0 votes
1 answer

How can I prevent or alter access to class variables in Python?

The ActiveState solution that Pynt references makes instances of ...READ MORE

answered Dec 5, 2018 in Python by aryya
• 7,380 points
133 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,349 views
0 votes
0 answers
0 votes
1 answer

How can I find script's directory with Python?

Hii, You need to call os.path.realpath on __file__, so that when __file__ is ...READ MORE

answered May 11 in Python by Niroj
• 57,260 points
72 views
0 votes
2 answers

How do I access command line arguments in Python?

import sys print(sys.argv) More specifically, if you run python example.py ...READ MORE

answered Jun 25 in Python by Karan
86 views