Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update a file in python egg

Tags:

python

egg

trac

We are using trac. In our setup we have a problem that is solved in repository. So I got the fixed file commit_update.py from the repository and I need to place it into Trac-0.12-py2.6.egg.

As egg is just a ziped filed I just unziped it, changed the file and ziped again. After restarting trac, I've got a an error message:

ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg 
cache:

    [Errno 20] Not a directory

The Python egg cache directory is currently set to: 

    /var/trac/plugin-cache

Perhaps your account does not have write access to this directory?  You can 
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

I don't quite understand why I got this error, because I'm running trac instance under www-data and it is the owner of the plugin-cache.

Will appreciate any ideas.

like image 833
bessarabov Avatar asked Sep 17 '10 14:09

bessarabov


People also ask

How do I update my python egg?

Just build a new egg (with python setup.py bdist_egg ), reinstall the egg and restart your trac instance.

Is Python egg deprecated?

Disclaimer: egg is an abandoned format of python package, the tools to use eggs no longer exist.


2 Answers

Just build a new egg (with python setup.py bdist_egg), reinstall the egg and restart your trac instance.

like image 131
knitti Avatar answered Sep 26 '22 02:09

knitti


I just unzip the egg file using

sudo unzip django_tastypie-0.9.11-py2.7.egg

This created a new folder in same path called tastypie, then, I changed files into it, and after that, I removed the egg file and keep using only the new folder.

like image 38
Alvaro Brange Avatar answered Sep 26 '22 02:09

Alvaro Brange