You are not logged in.

#1 2017-10-28 21:20:55

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 799
Website

Possible conflict between pip installed package and distro installed?

In another thread I have reported problems with running Nikola. I got some help from the Nikola crowd late yesterday. The conclusion is that something is broken with my Python 2.7 installation. Pip list does not only list installed modules but also throw exceptions at me. Pip3 list doesn't do that.

I try to stick with Python 3 for my own programming and have used pip3 for a while and mixed it with installing from repo. For Python 2.7 I only installed pip the other day to be able to install Nikola (and whatever else was pulled in). Everything else Python 2.7 have been installed from repo. Could this lead to issues?

More generally: how do I pin-point what has gone wrong? Is it possible or do I have to remove all things Python 2.7 and re-install?

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

#2 2017-10-28 21:34:45

nobody
The Great
Registered: 2015-08-10
Posts: 3,655

Re: Possible conflict between pip installed package and distro installed?

Better tell us the full error message / exception.

Check the file access modes in /usr/lib/python2.7/*. They should be 755 or 644, not 700 or 600.

Offline

#3 2017-10-28 22:08:59

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 799
Website

Re: Possible conflict between pip installed package and distro installed?

Regarding access modes: As far as I can see they are all OK.

pip list Exception:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/list.py", line 80, in run
    self.run_listing(options)
  File "/usr/lib/python2.7/dist-packages/pip/commands/list.py", line 142, in run_listing
    self.output_package_listing(installed_packages)
  File "/usr/lib/python2.7/dist-packages/pip/commands/list.py", line 151, in output_package_listing
    if dist_is_editable(dist):
  File "/usr/lib/python2.7/dist-packages/pip/util.py", line 367, in dist_is_editable
    req = FrozenRequirement.from_dist(dist, [])
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 299, in from_dist
    assert len(specs) == 1 and specs[0][0] == '=='
AssertionError

Running nikola build in debug mode results in plenty of output so I will not supply all here now. The bits that made us believe there is a problem with Python 2.7 are all about Unicode, ascii etc:

/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py:1892: UserWarning: /usr/lib/pymodules/python2.7/rpl-1.5.5.egg-info could not be properly decoded in UTF-8
  warnings.warn(msg)
[2017-10-28T22:01:14Z] WARNING: Nikola: Could not guess locale for language en, using locale C
[2017-10-28T22:01:14Z] WARNING: Nikola: Please fix your OS locale configuration or use the LOCALES option in conf.py to specify your preferred locale.
[2017-10-28T22:01:14Z] WARNING: Nikola: Make sure to use an UTF-8 locale to ensure Unicode support.
Scanning posts.[2017-10-28T22:01:15Z] WARNING: UnicodeWarning: /usr/lib/python2.7/genericpath.py:71: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

#4 2017-10-29 09:17:04

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 799
Website

Re: Possible conflict between pip installed package and distro installed?

I don't know if it helps but I just tried pip --version and got:

/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py:1892: UserWarning: /usr/lib/pymodules/python2.7/rpl-1.5.5.egg-info could not be properly decoded in UTF-8
  warnings.warn(msg)
pip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7)

pip3 --version does not come up with warnings.

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

#5 2017-10-30 06:21:07

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,741

Re: Possible conflict between pip installed package and distro installed?

This https://getnikola.com/getting-started.html says you want python 3.x, which doesn't answer why would 2.x be broken, just saying.

Online

#6 2017-10-30 06:32:49

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: Possible conflict between pip installed package and distro installed?

^ oh, that looks relevant. "2.7 partially supported" :scratchbeard:
did you follow the instructions with virtualenv etc.?

i have nothing constructive to offer (yet), but you're not the first person who has problems with python system-installed vs. pip-installed packages.

though the 2 vs 3 conflict seems to have stronger qi in this one.

Offline

#7 2017-10-30 07:35:46

Martin
Member
From: Stockholm, Sweden
Registered: 2015-10-01
Posts: 799
Website

Re: Possible conflict between pip installed package and distro installed?

Now I have a working Nikola in a virtualenv (this is totally new to me) but my Python 2.7 installation is still troubled. I now know why the rpl file caused trouble and I have unistalled rpl for now. The other issues persist.

The good news is I have a plan. My secondary computer also runs BL and there are no issues with Python 2.7 on that machine so I plan to compare the two.

Second good news: When Nikola complained about locale it had nothing to do with either Python or the Nikola installation. I had simply given the wrong answer to one of the questions you get when running nikola init.

/Martin


"Problems worthy of attack
prove their worth by hitting back."
Piet Hein

Offline

Board footer

Powered by FluxBB