Python package version conflict resolution in Reddit install

I am trying to get Python libraries for Reddit installed on my Mac. I want to run them using PyCharm for development, as I like it as a Python development environment.

I am running Cassandra, Memcached, RabbitMQ, and Postgres servers inside a Virtual Box instance, accessible through the Virtual Box Host-only adapter. This works, since I can run Reddit in Virtual Box and access it from my Mac is just fine.

When you run the paster script, to find out if the original installation of Reddit Python on Mac works. I get the following error:

Traceback (most recent call last): File "/Users/inflector/software/new-day/reddit/dev/bin/paster", line 8, in <module> load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')() File "/Users/inflector/software/new-day/reddit/dev/lib/python2.7/site-packages/paste/script/command.py", line 93, in run commands = get_commands() File "/Users/inflector/software/new-day/reddit/dev/lib/python2.7/site-packages/paste/script/command.py", line 135, in get_commands plugins = pluginlib.resolve_plugins(plugins) File "/Users/inflector/software/new-day/reddit/dev/lib/python2.7/site-packages/paste/script/pluginlib.py", line 82, in resolve_plugins pkg_resources.require(plugin) File "build/bdist.linux-i686/egg/pkg_resources.py", line 666, in require File "build/bdist.linux-i686/egg/pkg_resources.py", line 569, in resolve pkg_resources.VersionConflict: (WebOb 1.2.3 (/Users/inflector/software/new-day/reddit/dev/lib/python2.7/site-packages), Requirement.parse('webob==1.0.8')) 

If I lower the installation to WebOb 1.0.8, I get the opposite, it wants "WebOb> = 1.2".

'pip list' shows these packages:

 amqplib (1.0.2) Babel (0.9.6) bcrypt (1.0.2) Beaker (1.6.4) BeautifulSoup (3.2.1) beautifulsoup4 (4.2.1) boto (2.9.5) cffi (0.6) chardet (2.1.1) crypto (1.1.0) cssutils (0.9.5.1) Cython (0.19.1) decorator (3.4.0) FormEncode (1.2.6) kazoo (1.1) l2cs (2.0.2) lxml (3.2.1) Mako (0.8.1) MarkupSafe (0.18) nose (1.3.0) Paste (1.7.5.1) PasteDeploy (1.5.0) PasteScript (1.7.5) PIL (1.1.7) psycopg2 (2.5) py-bcrypt (0.3) pyasn1 (0.1.7) PyCAPTCHA (0.4) pycassa (1.9.0) pycountry (0.14.8) pycparser (2.09.1) pycrypto (2.6) Pygments (1.6) pylibmc (1.2.3) Pylons (0.9.7) pytz (2013b) repoze.lru (0.6) requests (1.2.3) Routes (1.11) rsa (3.1.1) simplejson (3.3.0) six (1.3.0) snudown (1.1.5) SQLAlchemy (0.7.4) stripe (1.9.1) Tempita (0.5.1) thrift (0.9.0) waitress (0.8.5) WebError (0.10.3) WebHelpers (1.3) WebOb (1.2.3) WebTest (2.0.6) Whoosh (2.4.1) wsgiref (0.1.2) zope.interface (4.0.5) 

My hypothesis is that at least one of these packages requires WebOb == 1.0.8, and at least the other requires WebOb> = 1.2

I installed virtualenv to install Reddit and installed it with the -no-site-packages option, so I only deal with the packages I need for Reddit. I manually installed everything I need. So this is actually a minimal set of packages. I need each of them, but maybe not all of them are the correct versions. The Reddit installer does not specify versions for each package, only some of them.

So how do I track these dependencies? How to get a list of requirements for each of the packages installed in virtualenv?

And where is the file: "build / bdist.linux-i686 / egg / pkg_resources.py"? I can not find it anywhere on my system. And the Mac is not Linux, so it seems weird.

I am a very experienced programmer, C ++, Java, Object Pascal, Objective-C, etc., but not a Python expert. So the Python package system is too big for me. I can use pip and run setup.py scripts, but I am not convincing them yet.

+4
source share
2 answers

The problem arose from version 2.0.6 of the WebTest library. This version was the one that required WebOb> = 1.2.

Define requirements for python modules. I cd'd to the site-packages directory for virtual env and then executed:

 grep WebOb *.egg-info/requires.txt 

which returned:

 Pylons-0.9.7-py2.7.egg-info/requires.txt:WebOb>=0.9.6.1 WebError-0.10.3-py2.7.egg-info/requires.txt:WebOb WebTest-2.0.6-py2.7.egg-info/requires.txt:WebOb>=1.2 

where I was able to see that WebTest was a conflicting package.

Then I was able to go into my Ubuntu installation to see which package for WebTest was installed, and found that WebTest 1.3.3 was working on a standard Ubuntu Reddit installation. So I uninstalled both WebOb 1.2 and WebTest 2.0.6, and then executed:

 pip install webob==1.0.8 pip install webtest==1.3.3 

This eliminated the conflict conflict WebOb conflict. I still cannot start Reddit, but at least I deleted this block.

+5
source

Reddit installer adds the Ubuntu private package repository . PPA includes many options for python packages in Ubuntu.

If you use Ubuntu, you can also install PPA.

0
source

Source: https://habr.com/ru/post/1486734/


All Articles