Repairing Python installation?

Chris Warrick kwpolska at gmail.com
Sun Oct 29 06:55:35 EDT 2017


On 28 October 2017 at 22:41, Martin Schöön <martin.schoon at gmail.com> wrote:
> It seems something is amiss with my Python 2.7 installation. Revisiting
> Nikola (static web site generator written in Python) for the first time
> in several years the other day I experience some unexpected problems. I
> got some help form the Nikola people and the conclusion is something
> is broken with my Python 2.7. Pip list throws exceptions at me while
> pip3 list works the way I expect it to do.
>
> All this is happening on a Debian machine.
>
> Questions:
>
> Should I try to pinpoint what is broken (and how is that done) or should
> I just remove everything Python 2.7 and re-install?
>
> Could mixing pip installs with Debian distro installs of Python
> packages lead to conflicts or other problems?

Yes, it does, you should avoid that at all cost. The best way to do it
is by using virtualenv.

> Today I tried pip --version and got the following:
> /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)

That’s a warning, and it happens to be caused by the `rpl` apt
package. Remove it from your system and try `pip --version` again:
https://github.com/certbot/certbot/issues/3795

Now, onto fixing Nikola issues:

As discussed on IRC, Nikola recommends (and will soon require) Python
3. And you’ll be better off with a virtualenv: install `virtualenv`
from apt and follow the Getting started guide for Nikola:
https://getnikola.com/getting-started.html

If you still get unicode issues when compiling posts, make sure
they’re saved as UTF-8, and that your locale is configured properly:
https://chriswarrick.com/blog/2017/06/18/unix-locales-vs-unicode/

(Nikola’s co-maintainer over here.)

-- 
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16



More information about the Python-list mailing list