LoginSignup
0
0

More than 3 years have passed since last update.

venv が動かないときの対応の一例

Posted at

状況

python -m venv $HOME/venv/3.6.8 などとしても、

Error: Command '['/home/tabaru/venv/3.6.8/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

となり、venv の設定ができない。

環境

  • icc --version とすると、Intel compiler が動く。
  • python --version とすると、 Python 3.6.8 :: Intel Corporation などと出力される。python 3系は python3 としないと呼ばれないはずなのに。
  • Ubunt 18.04 だが、おそらく distribution は無関係。
  • Intel compiler の設定を直前に行っていた。

原因

環境変数 PATH 中で Intel python の bin ディレクトリが先に書かれていたため、distribution の python コマンドが呼ばれていなかった。これにより、色々不具合が出ていた模様。

対策

PATH から Intel python のディレクトリを削除。
これにより、 python3 -m venv $HOME/venv/3.6.8 でエラーなく環境を作れた。

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