473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

customary way of keeping your own Python and module directory in $HOME

What's the customary way to keep your own local Python and package
directory? For example, when you're on a server where you don't have
root access, and everything must go in your home directory.

* What directories do you create?
* What environment variables do you set?
* What config files do you keep?
* Does that setup work with distutils and setuptools? What special
options do you need to pass to these tools when installing modules for
everything to work right?

Please, share your tips.

May 14 '07 #1
4 1544
jm*****@gmail.com wrote:
What's the customary way to keep your own local Python and package
directory? For example, when you're on a server where you don't have
root access, and everything must go in your home directory.

* What directories do you create?
* What environment variables do you set?
* What config files do you keep?
* Does that setup work with distutils and setuptools? What special
options do you need to pass to these tools when installing modules for
everything to work right?

Please, share your tips.
You can do more than you can imagine as non-root even if you have
hyper-paranoid sysadmins who don't know how to protect infrastructure
without shackling the users.

I don't know about windoze (pro-windoze complainers: yep, I'm spelling
it wrong on purpose, please complain elsewhere about my anti-windoze
spelling :P -- If you want to be a pro-windoze speller, take the time to
give your own answers instead of complaining all the time), but on *nix,
you can compile python with the "--prefix=" option set to a directory in
your home dir and install there. Because python is compiled with the
prefix, you will not need to adjust the path if you add modules to the
site-packages directory. If you have your own modules, but they aren't
ready for site-packages, you can alter PYTHONPATH to point at your
staging directory.

I recommend having your own python install if you want a comprehensive
approach. Sometimes you need to build your own Tcl/Tk and blt-wish if
you have a linux version that predates the python dependency
requirements, though. If you know the dependencies, its all very
"configure --prefix= ; make ; make install", with proper settings of
LD_LIBRARY path.

Doesn't seem like hyper-paranoid sysadmining is all that efficient, does it?

James
May 14 '07 #2
On May 14, 6:00 pm, James Stroud <jstr...@mbi.ucla.eduwrote:
jmg3...@gmail.com wrote:
[snip], but on *nix,
you can compile python with the "--prefix=" option set to a directory in
your home dir and install there.
Check.
I recommend having your own python install if you want a comprehensive
approach.
Yup. I dropped the src in ~/src/Python-2.5.1, created a ~/py-2.5.1
directory, and did

../configure --prefix=/home/me/py-2.5.1
make
make install

and it worked fine. The only other step after that was creating a
symlink:

cd
ln -s py-2.5.1 py

and adding /home/me/py/bin to my $PATH.
Doesn't seem like hyper-paranoid sysadmining is all that efficient, does it?
Well, on a server with many other users, they've pretty much gotta
keep you confined to your home directory.

My issues have been with keeping a ~/pylib directory for extra
modules, and reconciling that with setuptools / Easy Install. I'm
curious to hear how other folks manage their own local module
directory.

May 15 '07 #3
On May 14, 8:55 pm, jmg3...@gmail.com wrote:
On May 14, 6:00 pm, James Stroud <jstr...@mbi.ucla.eduwrote:
jmg3...@gmail.com wrote:
[snip], but on *nix,
you can compile python with the "--prefix=" option set to a directory in
your home dir and install there.

Check.
I recommend having your own python install if you want a comprehensive
approach.

Yup. I dropped the src in ~/src/Python-2.5.1, created a ~/py-2.5.1
directory, and did

./configure --prefix=/home/me/py-2.5.1
make
make install

and it worked fine. The only other step after that was creating a
symlink:

cd
ln -s py-2.5.1 py

and adding /home/me/py/bin to my $PATH.
Doesn't seem like hyper-paranoid sysadmining is all that efficient, does it?

Well, on a server with many other users, they've pretty much gotta
keep you confined to your home directory.

My issues have been with keeping a ~/pylib directory for extra
modules, and reconciling that with setuptools / Easy Install. I'm
curious to hear how other folks manage their own local module
directory.
I just do

../configure --prefix=$HOME;make;make install

My PATH has $HOME/bin, and LD_LIBRARY_PATH has $HOME/lib before the
system bin and lib directories. Everything works just fine. I do the
same thing for everything else I download for personal use when I want
to use a more up to date version of what's installed. For Windoze,
Python gets installed in C:\Python24 (or C:\Python25 now, I guess) and
you don't need admin rights for that. (Thank you, Python developers!)
May 15 '07 #4
On 15 Mai, 02:55, jmg3...@gmail.com wrote:
My issues have been with keeping a ~/pylib directory for extra
modules, and reconciling that with setuptools / Easy Install. I'm
curious to hear how other folks manage their own local module
directory.
For Python libraries, I use the workingenv.py (search Cheeseshop) for
keeping a separate environment for every application with all the
libraries it needs. This is great to dodge problems with two apps
requiring different, uncompatible versions of the same library, for
having different staging and production environments, and so on.

Once you activate an environment (in a shell or in your Python
script), the PYTHONPATH and the installation directories for distutils
and easy_install will be adapted automatically.

Chris

May 21 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: aznach | last post by:
Hello! I have a shared hosting account at GrokThis.net and have a problem with the module order of the Python search path. I'd like to use django's svn trunk instead of the...
6
by: matey | last post by:
I am have version 2.3.4. I want to write a python script to access a secure HTTPS. I tried the following: import urllib urllib.urlopen("https://somesecuresite.com") s = f.read() f.close()
15
by: John Nagle | last post by:
I've been installing Python and its supporting packages on a dedicated server with Fedora Core 6 for about a day now. This is a standard dedicated rackmount server in a colocation facility,...
3
by: gatoruss | last post by:
Newbie here with a (hopefully not) dumb question....tried searching around on the 'Net without success, so here goes.... I have been playing around with python. I wrote a script that sends an smtp...
24
by: Joe Salmeri | last post by:
I just upgraded from Python 2.4.2 to Python 2.5.1 and have found some unexpected behavior that appears to be a bug in the os.stat module. My OS is Windows XP SP2 + all updates. I have several...
3
by: sapsi | last post by:
Hello, I'm not sure if this the correct list but here goes (and sorry for the noise). I've been attempting to wrap python around libhdfs. So far so good (i've attached the SWIG template at the...
7
by: Yansky | last post by:
I asked my hosting company if they would upgrade Python on my server to the latest version. They responded with: "Sorry no. We tend to stick with what comes packaged with the unix distribution...
1
by: Martin Rubey | last post by:
Dear all, I'm trying to call from common lisp functions written for Sage (www.sagemath.org), which in turn is written in python. To do so, I tried...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.