unable to use pre-installed non-distutils-aware nevow #149

Closed
opened 2007-09-26 04:07:04 +00:00 by warner · 5 comments

I just tried to upgrade the tahoebs1 testnet nodes, and got the following error:

$ allmydata-tahoe --version
Traceback (most recent call last):
  File "/usr/bin/allmydata-tahoe", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2479, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 585, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 483, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: nevow>=0.6.0

On this system, nevow is installed just fine:

$ python
Python 2.5.1 (r251:54863, May  2 2007, 16:56:35) 
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import nevow
>>> nevow.__version__
'0.9.0'
>>> 

The only problem is that it wasn't installed with an .egg (or an .egg-info).
Most modern debian python packages contain .egg-info files, to let setuptools
know that the package is available, but I think this nevow package is a bit
behind the times.

Is there any way to allow perfectly usable support libraries like this get
used? Note that this checking is being done by the generated setuptools
entry-point script: the bin/allmydata-tahoe that we wrote just tries to
import and run, rather than checking for existence before importing.

I just tried to upgrade the tahoebs1 testnet nodes, and got the following error: ``` $ allmydata-tahoe --version Traceback (most recent call last): File "/usr/bin/allmydata-tahoe", line 5, in <module> from pkg_resources import load_entry_point File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2479, in <module> working_set.require(__requires__) File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 585, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 483, in resolve raise DistributionNotFound(req) # XXX put more info here pkg_resources.DistributionNotFound: nevow>=0.6.0 ``` On this system, nevow is installed just fine: ``` $ python Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import nevow >>> nevow.__version__ '0.9.0' >>> ``` The only problem is that it wasn't installed with an .egg (or an .egg-info). Most modern debian python packages contain .egg-info files, to let setuptools know that the package is available, but I think this nevow package is a bit behind the times. Is there any way to allow perfectly usable support libraries like this get used? Note that this checking is being done by the generated setuptools entry-point script: the bin/allmydata-tahoe that we wrote just tries to import and run, rather than checking for existence before importing.
warner added the
packaging
major
defect
0.5.1
labels 2007-09-26 04:07:04 +00:00
warner added this to the eventually milestone 2007-09-26 04:07:04 +00:00
zooko was assigned by warner 2007-09-26 04:07:04 +00:00

merging into #141

merging into #141
zooko added the
duplicate
label 2007-09-26 13:39:04 +00:00
zooko closed this issue 2007-09-26 13:39:04 +00:00
Author

This is happening again, in the new 1.3.0 release. Zooko's looked at it briefly, and we believe that the problem is that we inadvertently started using the setuptools-generated entry point script as bin/tahoe, even in the debian package. When we made the changes in #141, we expected to keep using the non-setuptools bin/tahoe that comes in our source package.

The rough problem is that some platforms (Ubuntu/gutsy, in this case) do not include .egg-info files for all the libraries that Tahoe uses. There is code in _auto_deps.py to tolerate this at runtime (i.e. so you can 'import allmydata' without those .egg-info files), but the entry-point script is harder to satisfy.

So the fix will be to stop using the setuptools-generated entry point script in the debian package.

Some platforms have the necessary .egg-info files, so it might work (I believe that debian/sid is one of these).

Also see #630 for details about the kind of what-debian-platforms-are-we-compatible-with tests that we'd like to run automatically, to detect this sort of thing sooner in the future.

This is happening again, in the new 1.3.0 release. Zooko's looked at it briefly, and we believe that the problem is that we inadvertently started using the setuptools-generated entry point script as bin/tahoe, even in the debian package. When we made the changes in #141, we expected to keep using the non-setuptools bin/tahoe that comes in our source package. The rough problem is that some platforms (Ubuntu/gutsy, in this case) do not include .egg-info files for all the libraries that Tahoe uses. There is code in _auto_deps.py to tolerate this at runtime (i.e. so you can 'import allmydata' without those .egg-info files), but the entry-point script is harder to satisfy. So the fix will be to stop using the setuptools-generated entry point script in the debian package. Some platforms have the necessary .egg-info files, so it might work (I believe that debian/sid is one of these). Also see #630 for details about the kind of what-debian-platforms-are-we-compatible-with tests that we'd like to run automatically, to detect this sort of thing sooner in the future.
warner added
critical
1.3.0
and removed
major
duplicate
0.5.1
labels 2009-02-18 02:24:29 +00:00
warner reopened this issue 2009-02-18 02:24:29 +00:00
Author

For gutsy debian packages, at least, it's sufficient to comment out the Nevow line in the egg-info/requires.txt file. We did that on our 'tahoecs2' gutsy machine and it seems to let the tahoe .deb run normally.

For gutsy debian packages, at least, it's sufficient to comment out the Nevow line in the egg-info/requires.txt file. We did that on our 'tahoecs2' gutsy machine and it seems to let the tahoe .deb run normally.

I changed the name of this ticket to emphasize that .egg-info files are not setuptools-specific. They are produced by default by distutils in all Python >= 2.5, and are the standard way for Python packages ("distributions") to declare their name and version number in a machine-parseable way. In the past some Linux distributions accidentally omitted the .egg-info files, but that is becoming more and more rare as everyone got used to Python 2.5 and as the maintainers of Linux distributions eventually realized that these files are not setuptools-specific. It is an unfortunate naming problem that they are named .egg-info even when the packages were produced by distutils without setuptools and were never packaged as eggs at any point in their entire development and deployment. Oh well. I think I'll open a ticket requesting that distutils automatically generate a symlink from ".pkg-info -> .egg-info" from now on...

Anyway, all that is merely an aside that I wish to emphasize in order that it will sink in to everyone who sees this ticket! The real point of this comment is that the underlying source of this problem is that nevow in Gutsy doesn't come with a .egg-info file. This problem was fixed starting in Hardy -- nevow there comes with a .egg-info file -- and presumably will remain fixed for all future versions of Ubuntu. So I'm closing this ticket as "wontfix" -- per discussion on #630 Ubuntu Hardy is the oldest version of Ubuntu on which new releases of Tahoe will have the runs-from-package property.

I changed the name of this ticket to emphasize that `.egg-info` files are not setuptools-specific. They are produced by default by distutils in all Python >= 2.5, and are the standard way for Python packages ("distributions") to declare their name and version number in a machine-parseable way. In the past some Linux distributions accidentally omitted the `.egg-info` files, but that is becoming more and more rare as everyone got used to Python 2.5 and as the maintainers of Linux distributions eventually realized that these files are not setuptools-specific. It is an unfortunate naming problem that they are named `.egg-info` even when the packages were produced by distutils without setuptools and were never packaged as eggs at any point in their entire development and deployment. Oh well. I think I'll open a ticket requesting that distutils automatically generate a symlink from ".pkg-info -> .egg-info" from now on... Anyway, all that is merely an aside that I wish to emphasize in order that it will sink in to everyone who sees this ticket! The real point of this comment is that the underlying source of this problem is that nevow in Gutsy doesn't come with a `.egg-info` file. This problem was fixed starting in Hardy -- nevow there comes with a `.egg-info` file -- and presumably will remain fixed for all future versions of Ubuntu. So I'm closing this ticket as "wontfix" -- per discussion on #630 Ubuntu Hardy is the oldest version of Ubuntu on which new releases of Tahoe will have the runs-from-package property.
zooko added the
wontfix
label 2009-03-12 15:10:15 +00:00
zooko closed this issue 2009-03-12 15:10:15 +00:00
zooko changed title from unable to use pre-installed non-setuptools-aware nevow to unable to use pre-installed non-distutils-aware nevow 2009-03-12 15:10:15 +00:00

(http://bugs.python.org/issue5480) # ".egg-info" => ".pkg-info"

(http://bugs.python.org/issue5480) # ".egg-info" => ".pkg-info"
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#149
No description provided.