LoginSignup
13
14

More than 5 years have passed since last update.

Ubuntu 14.04 LTSでPython 3.4のpyvenvが失敗する

Posted at

Python3.4のvenvをつくろうとすると・・・

$ pyvenv-3.4 <directory>
Error: Command '['<directory>/bin/python3.4', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1

と、エラーがでてしまいます。

直接コマンドを実行すると以下のようなエラーになるので、ensurepipモジュールがない、と。

<directory>/bin/python3.4: No module named ensurepip

仕方がないので、--without-pipオプションを付けてvenvを作ってから、手動でpipをインストールして回避してます。

$ pyvenv-3.4 --without-pip <directory>
$ source <directory>/bin/activate

# setuptoolsのインストール
$ curl -O https://pypi.python.org/packages/source/s/setuptools/setuptools-3.4.4.tar.gz
$ tar xvfz setuptools-3.4.4.tar.gz
$ cd setuptools-3.4.4/
$ python setup.py install

# pipのインストール
$ curl -O https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz
$ tar xvfz pip-1.5.4.tar.gz
$ cd pip-1.5.4/
$ python setup.py install

venvの再構築はそんなに手間じゃないのでとりあえず上記で回避しつつ修正待ち。

13
14
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
13
14