Allow to customize location of .eggs directory
See original GitHub issueApparently the PYTHON_EGG_CACHE environment variable does not affect the location of the .eggs
directory when building a Python package using a command like python setup.py build
: https://github.com/pypa/setuptools/blob/38b9010bc3527e89561c7a985e0908a3071b7ff5/setuptools/dist.py#L745
My code lives in a read-only partition mounted into a Docker container and therefore the build fails:
...
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 1077, in obtain
return installer(requirement)
File "/usr/local/lib/python3.6/dist-packages/setuptools/dist.py", line 778, in fetch_build_egg
install_dir = self.get_egg_cache_dir()
File "/usr/local/lib/python3.6/dist-packages/setuptools/dist.py", line 747, in get_egg_cache_dir
os.mkdir(egg_cache_dir)
OSError: [Errno 30] Read-only file system: './.eggs'
Setting the PYTHON_EGG_CACHE variable has no effect on this behavior, but I guess it should?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:7 (2 by maintainers)
Top Results From Across the Web
What is the Python egg cache (PYTHON_EGG_CACHE)?
From my investigations it turns out that some eggs are packaged as zip files, and are saved as such in Python's site-packages directory....
Read more >The Internal Structure of Python Eggs - Setuptools
For the .egg format, the base location is the .egg itself. That is, adding the .egg filename or directory name to sys.path makes...
Read more >Chapter 38 - The Python egg — Python 101 1.0 documentation
The egg file itself is basically a zip file. If you change the extension to “zip”, you can look inside it and see...
Read more >Bunny Day - Animal Crossing: New Horizons Wiki Guide - IGN
The different eggs can be used to craft unique Bunny Day recipes that are given by Zipper himself, learned by picking up eggs,...
Read more >Wilsonville Egg Hunt
Let's Talk, Wilsonville! News · Social Media · Subscribe. Parks & Rec Info. Email · Staff Directory. Parks & Rec Admin Building:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The point of this issue is that you could write them both in the current working directory (or somewhere else) instead of the project’s directory if write isn’t available there. Is there a specific reason why this would not be possible or desirable? Apart from saying “it’s not a valid use-case” while not suggesting a portable solution to a use-case that does exist for at least two people (and probably more).
Edit: FWIW, this is a polite and understandable yet firm answer. Saying “It’s not a valid use-case” out of nowhere is just being mean and condescending to the users and that doesn’t help. I feel disappointed this kind of behavior is still present in the python packaging community…
@gilbsgilbs @tgpfeiffer I had a slightly different problem when specifying an install directory
it erred out with a message that it could only write to a valid
site-packages
directory. As I workaround I set up a virtual environment and activated itAs a result under
/opt/myapp/lib/site-packages/lib
were mostly many compact ‘.egg’ files, and under '/opt/myapp/share
were many compact wheel files. The total memory used by the virtual environment only (containing python3, etc.) was 8mb, a small fraction of the total compact installed ‘myapp’ which came to 84mb.Of course to call ‘myapp’ pre-requires another call to ‘’’
$ /source opt/myapp/bin/activate ‘’’ I don’t grasp your exact usage requirements, but there seemed enough potential overlap I thought it might be worth posting this message.