473,837 Members | 1,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_st orage 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.p y",
line 799, in resource_filena me
return get_provider(pa ckage_or_requir ement).get_reso urce_filename(
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 1187, in get_resource_fi lename
self._extract_r esource(manager , self._eager_to_ zip(name))
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 1204, in _extract_resour ce
real_path = manager.get_cac he_path(self.eg g_name,
self._parts(zip _path))
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 836, in get_cache_path
ensure_director y(target_path)
File
"/usr/local/lib/python2.4/setuptools-0.6a10-py2.4.egg/pkg_resources.p y",
line 2301, in ensure_director y
os.makedirs(dir name)
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********@gma il.com>

Aug 31 '06 #1
3 4840
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********@gma il.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_CACH E=/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_CACH E=${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
1499
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 website with code samples
4
1276
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 to distribute bunch of them . If there is some way to bundle pyc files (akin to ..jar), it would be really nice. I understand that pyc files are not hard to decompile (from my reading of previous posts) and module startup times may be longer if...
5
1906
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 a great language even better. Alex -- http://tangentspace.net/cz
44
3809
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 product. A marketing/product manager has brought in additional management and "architecture" experts to propose moving the entire thing to a Java (application server) platform for the next release. They want a "scalable, enterprise solution"...
51
3041
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 bug-free, mature (that includes a long release distance) and useful enough to be granted a place in the stdlib? For my part, ctypes seems like a suggestion to start with.
2
1374
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 setup() and get my data files located in, say, /usr/local/mydata. However when I write my code, it would seem that I have to hardcode the above path. But this would mean that while working on the code I would need to have it 'installed' on my...
10
3501
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 -- just my local modules. This is not the same question that would be answered with py2exe or py2app. I don't need to package the script into a binary along with Python. I expect Python to be installed. I also don't want to use distutils to install...
12
1221
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
2260
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 it to run your app? Chris
13
1627
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 and as the name for the module. So when I develop the first version of my file I have to call it circle_a.py. The name of the module then automatically becomes circle_a. But when I develop the next increment and call my file circle_b.py the...
0
9852
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9696
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10902
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10583
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10642
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10288
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7014
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.