1
4

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.

Python モジュールを任意のディレクトリにインストール

Posted at

諸事情により、/usr 配下にモジュールをインストールできない(したくない)場合に

export PYTHONUSERBASE=インストールしたいディレクトリ
pip install パッケージ名 --user

--user: インストール先をユーザ環境に。デフォルトは ~/.local 配下にインストールされる

PYTHONUSERBASE 環境変数を設定しておくと、プログラム実行時のモジュールの探索パスに ${PYTHONUSERBASE}/lib/python[ver]/site-packages ディレクトリを追加してくれる

1
4
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
1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?