tracspamfilter/Ubuntu16/trac109 - "VersionConflict: Python 2.7.11-

44 views
Skip to first unread message

Jimbo

unread,
May 28, 2016, 2:30:57 PM5/28/16
to Trac Users
Hi, I've added tracspamfilter but see in /var/log/syslog:

svn Trac[loader] ERROR: Skipping "spamfilter.blogspam = tracspamfilter.filters.blogspam [json]": (version conflict "VersionConflict: (Python 2.7.11- (/usr/lib/python2.7/lib-dynload), Requirement.parse('python>=2.6'))")

Any help on this would be very gratefully received.

Ubuntu 16.04 LTS, installed from default repos trac 1.0.9, Python 2.7.11+
Tracspamfilter from https://trac.edgewall.org/browser/plugins/1.0/spam-filter?format=zip (builds TracSpamFilter-1.0.9.dev0-py2.7.egg)

Many thanks in advance.

RjOllos

unread,
May 28, 2016, 3:14:08 PM5/28/16
to Trac Users
It sounds similar to these issue:

However, the origin of the error looks different in these cases.

Which version of setuptools are you using or distribute are you using? Is it version >= 10?

How are you installing the package? Have you tried using pip?

- Ryan


Jun Omae

unread,
May 28, 2016, 3:21:10 PM5/28/16
to trac-...@googlegroups.com
It seems that python's version via pkg_resources is broken.
I consider that is a python2.7 ubuntu package issue.

Ubuntu 16.04:

Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
[GCC 5.3.1 20160413] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
>>> dist = pkg_resources.get_distribution('python')
>>> dist
Python 2.7.11- (/usr/lib/python2.7/lib-dynload)
>>> dist.version
u'2.7.11-' # <== should be '2.7' or '2.7.11'
>>> pkg_resources.require('python>=2.6')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py",
line 943, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py",
line 834, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (Python 2.7.11-
(/usr/lib/python2.7/lib-dynload), Requirement.parse('python>=2.6'))

Ubuntu 14.04:

Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
>>> dist = pkg_resources.get_distribution('python')
>>> dist
Python 2.7 (/usr/lib/python2.7/lib-dynload)
>>> dist.version
'2.7'
>>> pkg_resources.require('python>=2.6')
[Python 2.7 (/usr/lib/python2.7/lib-dynload)]


Workaround is to remove json requirement from extra_requires in
spam-filter/setup.py:

Index: setup.py
===================================================================
--- setup.py (revision 14809)
+++ setup.py (working copy)
@@ -60,7 +60,6 @@
'dns': ['dnspython>=1.3.5'],
'spambayes': ['spambayes'],
'pillow': ['pillow'],
- 'json': ['python>=2.6'],
'account': ['TracAccountManager >= 0.4'],
'oauth': ['oauth2'],
'httplib2': ['httplib2']
@@ -80,7 +79,7 @@
spamfilter.stopforumspam = tracspamfilter.filters.stopforumspam
spamfilter.botscout = tracspamfilter.filters.botscout
spamfilter.fspamlist = tracspamfilter.filters.fspamlist
- spamfilter.blogspam = tracspamfilter.filters.blogspam[json]
+ spamfilter.blogspam = tracspamfilter.filters.blogspam
spamfilter.mollom = tracspamfilter.filters.mollom[oauth,httplib2]
spamfilter.bayes = tracspamfilter.filters.bayes[spambayes]
spamfilter.extlinks = tracspamfilter.filters.extlinks


--
Jun Omae <jun...@gmail.com> (大前 潤)

RjOllos

unread,
May 28, 2016, 3:40:52 PM5/28/16
to Trac Users
I posted a possible workaround in:

- Ryan
 

Jimbo

unread,
May 29, 2016, 8:01:28 AM5/29/16
to Trac Users
Modifying setup.py as instructed seems to have worked.

Thanks all for the really fast help on this - it is very much appreciated.

RjOllos

unread,
May 30, 2016, 2:48:00 AM5/30/16
to Trac Users
On Sunday, May 29, 2016 at 5:01:28 AM UTC-7, Jimbo wrote:
Modifying setup.py as instructed seems to have worked.

Thanks all for the really fast help on this - it is very much appreciated.

If you wish to run unmodified code, and would like to confirm changes that were recently committed, you could try >= r14813.

https://trac.edgewall.org/changeset/14813

- Ryan

RjOllos

unread,
May 30, 2016, 3:45:06 AM5/30/16
to Trac Users


On Saturday, May 28, 2016 at 12:21:10 PM UTC-7, Jun Omae wrote:

The traceback I posted in (1) is probably related. I didn't find the issue reported in the Ubuntu issue tracker (2). I wonder if we should report this so that hopefully it gets fixed and we don't have to find a workaround.

- Ryan

(1) https://trac.edgewall.org/ticket/12491#comment:4
(2) https://bugs.launchpad.net/ubuntu

Jimbo

unread,
May 30, 2016, 5:44:03 AM5/30/16
to Trac Users

Ryan, thanks, R14815 looks to be OK.

Incidentally "sudo easy_install TracSpamFilter" doesn't work currently as it looks that the module isn't available (the folder is empty) - is this by design? Perhaps something for a different message list.

RjOllos

unread,
May 30, 2016, 1:35:09 PM5/30/16
to Trac Users


On Monday, May 30, 2016 at 2:44:03 AM UTC-7, Jimbo wrote:

Ryan, thanks, R14815 looks to be OK.

Incidentally "sudo easy_install TracSpamFilter" doesn't work currently as it looks that the module isn't available (the folder is empty) - is this by design? Perhaps something for a different message list.

The plugin needs to be uploaded to PyPI, but none of the current maintainers have permission to do so, and I haven't been able to get in touch with the original author. I added some comments about that in:

I'll make another attempt to get in touch with the original author to see if he can grant us permissions.

- Ryan 

RjOllos

unread,
Aug 30, 2016, 6:39:51 PM8/30/16
to Trac Users


On Saturday, May 28, 2016 at 12:21:10 PM UTC-7, Jun Omae wrote:
I considered reporting the issue, but it looks like it has been fixed now.

root@ubuntu:~# python

Python 2.7.12 (default, Jul  1 2016, 15:12:24) 

[GCC 5.4.0 20160609] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import pkg_resources

>>> pkg_resources.get_distribution('python')

Python 2.7.12 (/usr/lib/python2.7/lib-dynload)

>>> dist = pkg_resources.get_distribution('python')

>>> dist.version

'2.7.12'

>>> pkg_resources.require('python >= 2.6')

[Python 2.7.12 (/usr/lib/python2.7/lib-dynload)] 


root@ubuntu:~# lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 16.04.1 LTS

Release: 16.04

Codename: xenial


- Ryan
Reply all
Reply to author
Forward
0 new messages