Commits

Doug Hellmann committed b216a86

fix #41 by using the cached python where the wrappers are installed

Comments (0)

Files changed (3)

+2010-04-29  Doug Hellmann  <dhellmann@racemi.com>
+
+	* virtualenvwrapper.sh (virtualenvwrapper_get_python_version): Add
+	a comment about why we're using the $PATH python instead of the
+	one where the wrappers are installed.
+	(add2virtualenv): Use the install-tree python instead of the one
+	from $PATH.
+
 2010-04-26  Doug Hellmann  <dhellmann@racemi.com>
 
 	* virtualenvwrapper.sh (virtualenvwrapper_tempfile): Add a suffix

docs/en/history.rst

     <http://www.doughellmann.com/docs/virtualenvwrapper/es/>`__ via
     Manuel Kaufmann's fork at
     http://bitbucket.org/humitos/virtualenvwrapper-es-translation/
+  - Fixed improper use of python from ``$PATH`` instead of the
+    location where the wrappers are installed.  See `issue #41
+    <http://bitbucket.org/dhellmann/virtualenvwrapper/issue/41/>`__.
 
 2.1
 

virtualenvwrapper.sh

 
 # Prints the Python version string for the current interpreter.
 virtualenvwrapper_get_python_version () {
+    # Uses the Python from the virtualenv because we're trying to
+    # determine the version installed there so we can build
+    # up the path to the site-packages directory.
     python -c 'import sys; print ".".join(str(p) for p in sys.version_info[:2])'
 }
 
     touch "$path_file"
     for pydir in "$@"
     do
-        absolute_path=$(python -c "import os; print os.path.abspath(\"$pydir\")")
+        absolute_path=$("$VIRTUALENVWRAPPER_PYTHON" -c "import os; print os.path.abspath(\"$pydir\")")
         if [ "$absolute_path" != "$pydir" ]
         then
             echo "Warning: Converting \"$pydir\" to \"$absolute_path\"" 1>&2