472,960 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Egg problem (~/.python-eggs)

I'm trying to install a program that uses Durus on a server. It
appears that if a Python program uses eggs, it creates a
~/.python-eggs/ directory, so the home directory must be writeable.
This conflicts with server environments where you want to run a daemon
with minimum privileges. Second, it appears to use the real user ID
rather than the effective user ID to choose the home directory. In
this case I'm trying to use start-stop-daemon on Linux to start my
Python program, switching from user 'root' to user 'apache'.

# start-stop-daemon --start --chuid apache:apache --make-pidfile
--pidfile /var/run/cameo.pid --exec
/var/www/apps/cameo/bin/cameo_server.py --
Traceback (most recent call last):
File "/var/www/apps/cameo/bin/cameo_server.py", line 3, in ?
from durus.client_storage import ClientStorage
File "build/bdist.linux-i686/egg/durus/client_storage.py", line 7, in
?
File "build/bdist.linux-i686/egg/durus/serialize.py", line 9, in ?
File "build/bdist.linux-i686/egg/durus/persistent.py", line 15, in ?
File "build/bdist.linux-i686/egg/durus/_persistent.py", line 7, in ?
File "build/bdist.linux-i686/egg/durus/_persistent.py", line 4, in
__bootstrap__
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.py",
line 799, in resource_filename
return get_provider(package_or_requirement).get_resource_ filename(
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.py",
line 1187, in get_resource_filename
self._extract_resource(manager, self._eager_to_zip(name))
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.py",
line 1204, in _extract_resource
real_path = manager.get_cache_path(self.egg_name,
self._parts(zip_path))
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.py",
line 836, in get_cache_path
ensure_directory(target_path)
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.py",
line 2301, in ensure_directory
os.makedirs(dirname)
File "/usr/lib/python2.4/os.py", line 156, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.4/os.py", line 156, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.4/os.py", line 159, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/root/.python-eggs'
Can I make it use a different eggs directory? Any other idea how to
install a program using eggs on a server?

BTW, Python is Gentoo's /usr/bin/python 2.4.2. The eggs are installed
in /usr/local/lib/python2.4 to prevent them from mixing with Gentoo
packages in /usr/lib.

--Mike <sl********@gmail.com>

Aug 31 '06 #1
3 4789
Mike Orr wrote:
I'm trying to install a program that uses Durus on a server. It
appears that if a Python program uses eggs, it creates a
~/.python-eggs/ directory, so the home directory must be writeable.
This conflicts with server environments where you want to run a daemon
with minimum privileges. Second, it appears to use the real user ID
rather than the effective user ID to choose the home directory. In
this case I'm trying to use start-stop-daemon on Linux to start my
Python program, switching from user 'root' to user 'apache'.
I solved the immediate problem by reinstalling Durus as a directory egg
rather than a compressed egg. So is the answer just not to use
compressed eggs?

--Mike <sl********@gmail.com>

Aug 31 '06 #2
>I'm trying to install a program that uses Durus on a server. It
appears that if a Python program uses eggs, it creates a
~/.python-eggs/ directory, so the home directory must be writeable.
This conflicts with server environments where you want to run a daemon
with minimum privileges. Second, it appears to use the real user ID
rather than the effective user ID to choose the home directory. In
this case I'm trying to use start-stop-daemon on Linux to start my
Python program, switching from user 'root' to user 'apache'.

I solved the immediate problem by reinstalling Durus as a directory egg
rather than a compressed egg. So is the answer just not to use
compressed eggs?
If the .egg file contains binary modules, those must be unpacked out of
the .egg (a Zip file actually) so that the kernel/lib-loader can map them.
If your .egg package doesn't have any binary modules, then it doesn't need
to unpack anything.
--
damjan
Aug 31 '06 #3
Mike Orr wrote:
[... snipp ...]
Can I make it use a different eggs directory? Any other idea how to
install a program using eggs on a server?
I had a similar issue with tracd on gentoo. My solution was setting
PYTHON_EGG_CACHE=/tmp/.egg_cache in /etc/conf.d/tracd and exporting that
var in /etc/init.d/tracd before calling start-stop-daemon, e.g.

export PYTHON_EGG_CACHE=${PYTHON_EGG_CACHE}
start-stop-daemon --start ....
cheers
Paul

Sep 1 '06 #4

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

Similar topics

1
by: RK | last post by:
Hi I am new to Python, find it very interesting. I was wondering if anyone has a sample source listing for an nntp newsgroup reader that they can share or will be able to point me to a...
4
by: draghuram | last post by:
Hi, I am sure that this question might have come up repeatedly. Companies may not want to distribute their python code in source form. Even though pyc files are one option, it gets inconvenient...
5
by: Alex Gittens | last post by:
I'm new to Python from Perl, and loving it. Has there ever been any discussion of creating a similar resource as CPAN for Python, or a similar distribution method as PPMs? Seems like it would make...
44
by: flyingfred0 | last post by:
A small software team (developers, leads and even the manager when he's had time) has been using (wx)Python/PostgreSQL for over 2 years and developed a successful 1.0 release of a client/server...
51
by: Reinhold Birkenfeld | last post by:
Hello, at the moment python-dev is discussing including Jason Orendorff's path module into the standard library. Do you have any other good and valued Python modules that you would think are...
2
by: Rajarshi Guha | last post by:
Hi, I've been trying to package a python project and I'm a little confused about how I distribute some PNG's that the program uses as icons. Using distutils I can set the data_files argument of...
10
by: Noah | last post by:
I would like to package my main script and all the modules it imports into a single script that will run just as the collection would. It should not need to package standard Python lib modules --...
12
by: Bo Peng | last post by:
Dear list, Is there a better way than doing try: import aModule except: has_aModule = False else: has_aModule = True
9
by: seberino | last post by:
I have been using distuils for a while and was wondering when Python Eggs (new project) is better? So basically Python Eggs precompiles and compresses binaries for you so you just have to load...
13
by: bobueland | last post by:
I'm a newbie experimenting with Python. I want to incrementally develop a module called 'circle'. The problem is now that the file name is used for two purposes. To keep track of the version number...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.