LoginSignup
3
6

More than 5 years have passed since last update.

Ubuntu16.04にPython3.6をインストールするとget-pip.py実行時にエラー

Last updated at Posted at 2018-05-04

5月に入ってから急に失敗するようになったのでメモ。

インストールの仕方は公式ページより
https://www.python.jp/install/ubuntu/index.html

4月までは大丈夫だったのに、上記の「get-pip.py」を実行すると以下のようなエラー

ImportError: cannot import name 'sysconfig'

python3.6を起動して、import sysconfigをすると特に問題なし。原因がよくわからない。

暫定的な解決策

PPAを変えたらいけた。

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6 python3.6-dev
wget https://bootstrap.pypa.io/get-pip.py
sudo python3.6 get-pip.py

追記

apt installを使ってpipsetuptoolsをインストールする方法。Ubuntu18.04などで初期状態からpython3.6がインストールされている場合に有効

sudo apt install python3-pip
sudo apt install python3-setuptools

python3のコマンドは必要に応じて読み替えてください。Ubuntu18.04でpipがついていませんでしたが、これでインストールできました(get-pip.pyは相変わらずエラー出る)。

参考情報

3
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
6