Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Created August 2, 2017 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkuchiki/fcf03e1b2b63899ad6f51a59e3fab210 to your computer and use it in GitHub Desktop.
Save tkuchiki/fcf03e1b2b63899ad6f51a59e3fab210 to your computer and use it in GitHub Desktop.
pip でインストールしたモジュールが /usr/lib と /usr/local/lib どちらに入っているか調べる

/usr/local/lib 以下に入っているモジュールの一覧を出力

$ for p in $(pip list --format=columns | awk 'NR > 2 {print $1}'); do pip show $p | grep ^Location | grep -qs local && echo $p ; done

/usr/lib 以下に入っているモジュールの一覧を出力

$ for p in $(pip list --format=columns | awk 'NR > 2 {print $1}'); do pip show $p | grep ^Location | grep -vqs local && echo $p ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment