0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ラズパイ(Raspbian Jessie)でpythonのvenvしたときにErrorで詰まった話

0
Posted at

環境

  • Raspberry Pi 3
  • Raspbian Jessie
  • Python 3.4 (Python 2系と共存)

起きたこと

ラズパイでFlask開発しようと思い,本家ページを見ながら導入しようとしたとき,以下のエラーが発生

$ python3 -m venv app
Error: Command '['/(パス)/app/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1

このエラーを調べると,次のようにpipインストールを回避して,後からpip入れればいいやん,という対策が多くヒット.

$ python3 -m venv --without-pip app

ただこの後のpipインストールが仮想環境を構築するたび毎回するのは面倒.

対策

色々試していると,どうもensurepipのモジュールが入っていない様子.

$ python3 -m ensurepip
/usr/bin/python3: No module named ensurepip

以下コマンドでvenvできるようになりました.

$ sudo apt install python3-venv
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?