LoginSignup
23
24

More than 5 years have passed since last update.

Python のモジュール探索パス追加の仕方

Posted at

プログラム内部でのやりかた

import sys,os
sys.path.append('モジュールをインストールしたディレクトリ')

(例)
sys.path.append('/tmp/hoge/lib/python2.7/site-packages')

コマンドライン

export PYTHONPATH=モジュールをインストールしたディレクトリ

(例)
export PYTHONPATH='/tmp/hoge/lib/python2.7/site-packages'

23
24
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
23
24