472,976 Members | 1,629 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,976 software developers and data experts.

Odd files; just left behind?

I see a folder .python-eggs in my home directory on one of our servers with
various .so files

~/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so

are these just left behind from some install process?
--
Robin Becker

Sep 19 '07 #1
10 1633
Robin Becker <ro***@reportlab.comwrites:
I see a folder .python-eggs in my home directory on one of our servers
with various .so files

~/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so

are these just left behind from some install process?
Ah, it's about the resource extraction feature of setuptools. It's
possible for zipped eggs to contain resources that have to be
extracted to the filesystem. It puts them in the directory you saw
(or somewhere else -- see the docstring in my other reply).

http://peak.telecommunity.com/DevCen...rce-extraction
http://peak.telecommunity.com/DevCen...rce-extraction

John
Sep 19 '07 #2
John J. Lee wrote:
Robin Becker <ro***@reportlab.comwrites:
>I see a folder .python-eggs in my home directory on one of our servers
with various .so files

~/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so

are these just left behind from some install process?

Ah, it's about the resource extraction feature of setuptools. It's
possible for zipped eggs to contain resources that have to be
extracted to the filesystem. It puts them in the directory you saw
(or somewhere else -- see the docstring in my other reply).

http://peak.telecommunity.com/DevCen...rce-extraction
http://peak.telecommunity.com/DevCen...rce-extraction
......
Thanks John, but why not clean up?

--
Robin Becker
Sep 19 '07 #3
Robin Becker a écrit :
John J. Lee wrote:
>Robin Becker <ro***@reportlab.comwrites:
>>I see a folder .python-eggs in my home directory on one of our servers
with various .so files

~/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so
are these just left behind from some install process?


Ah, it's about the resource extraction feature of setuptools. It's
possible for zipped eggs to contain resources that have to be
extracted to the filesystem. It puts them in the directory you saw
(or somewhere else -- see the docstring in my other reply).

http://peak.telecommunity.com/DevCen...rce-extraction
http://peak.telecommunity.com/DevCen...rce-extraction

.....
Thanks John, but why not clean up?
Does it needs to be "cleaned up" ? .so files (shared libs) *need* to be
extracted from the egg to be usable. Where they are extracted is IIRC
configurable...
Sep 20 '07 #4
Bruno Desthuilliers wrote:
Robin Becker a écrit :
>John J. Lee wrote:
>>Robin Becker <ro***@reportlab.comwrites:

I see a folder .python-eggs in my home directory on one of our servers
with various .so files

~/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so
are these just left behind from some install process?

Ah, it's about the resource extraction feature of setuptools. It's
possible for zipped eggs to contain resources that have to be
extracted to the filesystem. It puts them in the directory you saw
(or somewhere else -- see the docstring in my other reply).

http://peak.telecommunity.com/DevCen...rce-extraction
http://peak.telecommunity.com/DevCen...rce-extraction
.....
Thanks John, but why not clean up?
Does it needs to be "cleaned up" ? .so files (shared libs) *need* to be
extracted from the egg to be usable. Where they are extracted is IIRC
configurable...
You're right! These files aren't temporary? It seems strange that the python
files live with their associated lib/site-packages and the .so files are
somewhere entirely different.

Python 2.3.6 (#1, Jun 7 2007, 10:44:52)
[GCC 3.4.4 [FreeBSD] 20050518] on freebsd6
Type "help", "copyright", "credits" or "license" for more information.
>>import MySQLdb
print MySQLdb.__file__
/myhome/PYTHON/lib/python2.3/site-packages/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg/MySQLdb/__init__.pyc
>>import _mysql
print _mysql.__file__
/myhome/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so
>>>
it would seem simpler to have the .so files inside the site-packages and there's
the question of why this folder has to be obfuscated (name starts with .). Even
if these files are "resources" why should they be assumed to belong to the user?
I could make the PYTHON folder world usable, but that won't help if I make all
other things in myhome private. Surely code resources belong in the same area as
the code that uses them.

Just another nonsense from the eggworld
--
Robin Becker

Sep 21 '07 #5
Robin Becker a écrit :
Bruno Desthuilliers wrote:
>Robin Becker a écrit :
>>John J. Lee wrote:

Robin Becker <ro***@reportlab.comwrites:

I see a folder .python-eggs in my home directory on one of our servers
with various .so files
>
~/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so
>
>
are these just left behind from some install process?

Ah, it's about the resource extraction feature of setuptools. It's
possible for zipped eggs to contain resources that have to be
extracted to the filesystem. It puts them in the directory you saw
(or somewhere else -- see the docstring in my other reply).

http://peak.telecommunity.com/DevCen...rce-extraction

http://peak.telecommunity.com/DevCen...rce-extraction

.....
Thanks John, but why not clean up?
Does it needs to be "cleaned up" ? .so files (shared libs) *need* to
be extracted from the egg to be usable. Where they are extracted is
IIRC configurable...
You're right! These files aren't temporary?

It seems strange that the
python files live with their associated lib/site-packages and the .so
files are somewhere entirely different.
IIRC, where .so files are extracted is configurable using
PYTHON_EGG_CACHE (cf the first link above).
Python 2.3.6 (#1, Jun 7 2007, 10:44:52)
[GCC 3.4.4 [FreeBSD] 20050518] on freebsd6
Type "help", "copyright", "credits" or "license" for more information.
>>import MySQLdb
>>print MySQLdb.__file__
/myhome/PYTHON/lib/python2.3/site-packages/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg/MySQLdb/__init__.pyc
>>import _mysql
>>print _mysql.__file__
/myhome/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so
>>>

it would seem simpler to have the .so files inside the site-packages and
there's the question of why this folder has to be obfuscated (name
starts with .). Even if these files are "resources" why should they be
assumed to belong to the user?
Notice that you did install your lib/python in /myhome, not in /usr[/local]

(snip)
Just another nonsense from the eggworld
Or just another example of not reading the FineManual(tm) ?
Sep 21 '07 #6
Bruno Desthuilliers wrote:
.........
> >>>

it would seem simpler to have the .so files inside the site-packages and
there's the question of why this folder has to be obfuscated (name
starts with .). Even if these files are "resources" why should they be
assumed to belong to the user?

Notice that you did install your lib/python in /myhome, not in /usr[/local]
yes, so should I then assume that the root installs will put all the .so files
in /usr/local/lib/.python-eggs?

In fact when I look at my root installed pythons they seem quite happy to put
the _mysql.so underneath site-packages. I suspect that if I just installed from
source I'd get that behaviour, but the egg stuff is different.
>
(snip)
>Just another nonsense from the eggworld

Or just another example of not reading the FineManual(tm) ?
well I didn't write the installer or the associated egg setup. The egg things
are supposed to do the right thing, but perhaps they're too difficult for the
egg layers.
--
Robin Becker

Sep 21 '07 #7
Robin Becker a écrit :
Bruno Desthuilliers wrote:
........
>> >>>

it would seem simpler to have the .so files inside the site-packages
and there's the question of why this folder has to be obfuscated
(name starts with .). Even if these files are "resources" why should
they be assumed to belong to the user?

Notice that you did install your lib/python in /myhome, not in
/usr[/local]

yes, so should I then assume that the root installs will put all the .so
files in /usr/local/lib/.python-eggs?

In fact when I look at my root installed pythons they seem quite happy
to put the _mysql.so underneath site-packages. I suspect that if I just
installed from source I'd get that behaviour, but the egg stuff is
different.
>>
(snip)
>>Just another nonsense from the eggworld

Or just another example of not reading the FineManual(tm) ?

well I didn't write the installer or the associated egg setup. The egg
things are supposed to do the right thing, but perhaps they're too
difficult for the egg layers.
Can't tell. So far, I've had no problem with eggs, so...
Sep 21 '07 #8
Robin Becker wrote:
Bruno Desthuilliers wrote:
>Robin Becker a écrit :
>>John J. Lee wrote:

Robin Becker <ro***@reportlab.comwrites:

I see a folder .python-eggs in my home directory on one of our servers
with various .so files
>
~/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so
>
>
are these just left behind from some install process?
Ah, it's about the resource extraction feature of setuptools. It's
possible for zipped eggs to contain resources that have to be
extracted to the filesystem. It puts them in the directory you saw
(or somewhere else -- see the docstring in my other reply).

http://peak.telecommunity.com/DevCen...rce-extraction
http://peak.telecommunity.com/DevCen...rce-extraction

.....
Thanks John, but why not clean up?
Does it needs to be "cleaned up" ? .so files (shared libs) *need* to be
extracted from the egg to be usable. Where they are extracted is IIRC
configurable...
You're right! These files aren't temporary?
They're a cache.
It seems strange that the python
files live with their associated lib/site-packages and the .so files are
somewhere entirely different.

Python 2.3.6 (#1, Jun 7 2007, 10:44:52)
[GCC 3.4.4 [FreeBSD] 20050518] on freebsd6
Type "help", "copyright", "credits" or "license" for more information.
>>import MySQLdb
>>print MySQLdb.__file__
/myhome/PYTHON/lib/python2.3/site-packages/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg/MySQLdb/__init__.pyc
>>import _mysql
>>print _mysql.__file__
/myhome/.python-eggs/MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg-tmp/_mysql.so
>>>

it would seem simpler to have the .so files inside the site-packages and there's
the question of why this folder has to be obfuscated (name starts with .). Even
if these files are "resources" why should they be assumed to belong to the user?
Because they are unpacked at runtime by the user that imported the module.
Usually, they won't have write access to site-packages.
I could make the PYTHON folder world usable, but that won't help if I make all
other things in myhome private. Surely code resources belong in the same area as
the code that uses them.
Well, you can't import a .so from a zip file. Thus they need to be placed
somewhere else. Don't worry about making ~/.python-eggs world readable. When
other users import the package, they will have the .so's unpacked, too.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Sep 21 '07 #9
Robin Becker <ro***@reportlab.comwrites:
Bruno Desthuilliers wrote:
........
>> >>>

it would seem simpler to have the .so files inside the
site-packages and there's the question of why this folder has to be
obfuscated (name starts with .). Even if these files are
"resources" why should they be assumed to belong to the user?

Notice that you did install your lib/python in /myhome, not in /usr[/local]

yes, so should I then assume that the root installs will put all the
.so files in /usr/local/lib/.python-eggs?
No no -- the extraction of these .so files happens at *runtime*, so it
has to write the files somewhere it has permission to write to. It's
like RL's zipapp resource extraction feature in fact, except the
resource extraction happens at runtime. See those web pages I pointed
you at before.

In fact when I look at my root installed pythons they seem quite happy
to put the _mysql.so underneath site-packages. I suspect that if I
just installed from source I'd get that behaviour, but the egg stuff
is different.
Not sure without all the details, but I suspect those are non-egg
installs.
John
Sep 22 '07 #10
Robin Becker wrote:
Robert Kern wrote:
.......
>They're a cache.

they're actually the files that get used by the installed extension in
this case (MySQLdb).
Yes. They are extracted from the zipfile at runtime and left there so they don't
have to be extracted again. That's why I called it a cache. I didn't mean
anything else by the term.
..........
>>it would seem simpler to have the .so files inside the site-packages and there's
the question of why this folder has to be obfuscated (name starts with .). Even
if these files are "resources" why should they be assumed to belong to the user?
Because they are unpacked at runtime by the user that imported the module.
Usually, they won't have write access to site-packages.

in this particular case the python being used was installed with a user
prefix eg /myhome/PYTHON so everything belongs to the user; extensions
installed by the same user can surely be installed in those folders.
Upon checking I find that the same installs which produced the
~/.python-eggs files also managed to put the eggs like
MySQL_python-1.2.2-py2.3-freebsd-6.1-SECURITY-i386.egg inside the
various site-packages directories.

I see no reason why the binary resources shouldn't be unpacked to
site-packages at install time.
Then do so: Use the -Z argument to easy_install such that it always unpacks the
zip file. If you don't, then the egg will be left zipped, and the resources
extracted at runtime. Zipped eggs have benefits over the unzipped eggs in that
they decrease the amount of import overhead of having many items in your sys.path.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Sep 23 '07 #11

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

Similar topics

2
by: Kiteman \(Canada\) | last post by:
A recent posting here discussed looking inside the .vbp project file. I noticed the following in one of my .vbp files (VB6.0 Learning Edition) Type=Exe ...
7
by: Batista, Facundo | last post by:
People: I'm trying to convert my father from using COBOL to Python, :) One difficult thing we stuck into is how to read, from python, files written with COBOL. Do you know a module that...
51
by: Harlan Messinger | last post by:
Are files referenced in LONGDESC attributes supposed to be pure text; can or should they have either block or inline HTML tags; can or should they be set up as a fully W3C compliant web page (with...
4
by: Chris | last post by:
I work on a development server (Server A), and have a staging server (Server B), where updated ASP.Net files from Server A are sent to. I noticed that Server B will reflect changes made to .aspx...
7
by: Alan Silver | last post by:
Hello, I am just looking at VWD and seeing what needs doing to take an existing site I've written by hand and importing it into VWD. I've already discovered that I need to rename my code-behind...
8
by: vinesh | last post by:
I have sample Asp.Net Web Application project. Let me know how to keep the files related to this project (like the webform.aspx, WebForm1.aspx.vb, WebForm1.aspx.resx) in a separate folder within a...
2
by: Trac Bannon | last post by:
I finally figured out how set up my VS deployment project to remove a previous version (I was not setting the productdoe or version number). While I have been testing, I notice that if I choose...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
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...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
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...

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.