Permalink
Browse files

Add pypidir function.

To get directory of installed python package.
  • Loading branch information...
1 parent ed0340e commit 49088e6958c24fa83208926e3e425d8a7db2e1e5 @blaix committed Apr 24, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 home/.bash_profile
View
@@ -92,3 +92,10 @@ alias cd=pvm_cd
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
export VIRTUALENV_USE_DISTRIBUTE=true
+
+pypidir() {
+ # From http://stackoverflow.com/questions/122327/how-do-i-find-the-location-of-my-python-site-packages-directory
+ package_dir=`python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"`
+
+ echo "$package_dir/$1"
+}

0 comments on commit 49088e6

Please sign in to comment.