Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 06-23-2010, 12:04 PM   #1
LQ Newbie
Registered: Jun 2010
Posts: 2

Rep: Reputation: 0
Specifying the install path of a Python package on linux server.


I have been trying to install the NumPy package for Python on to my home directory, as I run as part of a server and do not have permissions to install new packages in the Linux server.

I have set up Python in my home directory, and have configured ~/.bash_profile to find my local Python (which works, confirmed by testing).

However, when I attempt to install the NumPy package, I get the message
error: could not create '/usr/local/lib/python2.6': Permission denied
Which I find strange because I do not see why it would need to install files anywhere except my local Python directory.

Does anyone know how I might be able to specify the directory in which files are installed?

Thank you,

Old 06-23-2010, 02:44 PM   #2
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ. .. ..

I don't think, you can override system settings
with an entry to the file ~/.bash_profile.

The full path will work. Example :
cd numpy/
/home/knudfl/python262/bin/python build
/home/knudfl/python262/bin/python install
.. which will provide ..

Last edited by knudfl; 06-23-2010 at 02:50 PM.
Old 06-24-2010, 11:24 AM   #3
LQ Newbie
Registered: Jun 2010
Posts: 2

Original Poster
Rep: Reputation: 0

I figured out a solution yesterday, though I am not sure it is the most efficient method. It involves setting an install path using a prefix=path method such as below:

python install --home=~ \
--install-purelib=~/Python-2.6.5/Lib \
--install-platlib=~/Python-2.6.5/Lib \

This worked for me, though extra lines may be added (--install-scripts=... for example). I suppose it was the libraries that Python was trying to install in the wrong directory. (Note, for any fellow Linux newcomers like myself, the ~ symbol is only present to direct towards my home directory. It is not part of any special syntax central to this concept).



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
specifying a directory path in python suran Linux - General 1 11-20-2009 12:00 PM
How can I uninstall a python package installed with python install? milomak Linux - Software 1 11-16-2009 09:22 PM
how to uninstall a path variable and a software package in linux open suse 11.1 sonu kumar Linux - Newbie 3 08-22-2009 02:23 AM
dpkg wont install gmail-notify b/c depends on obselete python package baldy1324 Debian 3 08-11-2006 04:56 PM
Java can't find package, but PATH set correctly (j2se1.4.0, java.util.regex package) Ethan Programming 5 02-06-2004 09:55 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration