Posted at

Google Cloud Platform + Ubuntu + python3.6 でエラー

More than 1 year has passed since last update.

Google Cloud Platform で初めてインスタンスを立ち上げて、ssl でつないぎ

環境を整えるためにpython3.6 をUbuntu にインストールし他ところ見かけないエラーが出たので、メモ

$ sudo apt install python3.6-venv

$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python3.6 get-pip.py

$ python3.6 -m pip list -o


Exception:
Traceback (most recent call last):
File "/home/kentaro/ven/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/kentaro/ven/lib/python3.6/site-packages/pip/commands/list.py", line 157, in run
packages = self.get_outdated(packages, options)
File "/home/kentaro/ven/lib/python3.6/site-packages/pip/commands/list.py", line 168, in get_outdated
dist for dist in self.iter_packages_latest_infos(packages, options)
File "/home/kentaro/ven/lib/python3.6/site-packages/pip/commands/list.py", line 169, in <listcomp>
if dist.latest_version > dist.parsed_version
TypeError: '>' not supported between instances of 'Version' and 'SetuptoolsVersion'

見かけないエラーだなーと思いパッケージをアップグレードすると症状は解消された。

$ python3.6 -m pip install --upgrade pip setuptools wheel

$ python3.6 -m pip list

Package Version
-------------------- -------
Django 1.11.4
django-debug-toolbar 1.8
django-extensions 1.8.1
pip 9.0.1
pkg-resources 0.0.0
pytz 2017.2
setuptools 36.2.7
six 1.10.0
sqlparse 0.2.3
wheel 0.29.0