[MacPorts] #45819: virtualenv python is missing module search paths that are available when running bare python27.

MacPorts noreply at macports.org
Sat Nov 8 07:05:11 PST 2014


#45819: virtualenv python is missing module search paths that are available when
running bare python27.
------------------------------+----------------------
  Reporter:  justinjereza@…   |      Owner:  larryv@…
      Type:  defect           |     Status:  assigned
  Priority:  Normal           |  Milestone:
 Component:  ports            |    Version:  2.3.2
Resolution:                   |   Keywords:
      Port:  py27-virtualenv  |
------------------------------+----------------------
Changes (by larryv@…):

 * owner:  macports-tickets@… => larryv@…
 * status:  new => assigned


Old description:

> I used the following script to print a list of module search paths:
>
> #!/usr/bin/env python
>
> import sys
>
> for i in sys.path:
>     if not i.startswith('/Users'):
>         print i
>
> The result from the py27-virtualenv version of python is as follows:
>
> /private/tmp
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /plat-darwin
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /lib-tk
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /plat-mac
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /plat-mac/lib-scriptpackages
>
> The result from the python27 is as follows:
>
> /private/tmp
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /plat-darwin
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /plat-mac
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /plat-mac/lib-scriptpackages
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /lib-tk
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /lib-old
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /lib-dynload
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /site-packages
>
> As you can see, there are a lot of paths missing in the virtualenv
> version resulting in preventing the use of python modules installed via
> macports in conjunction with virtualenv.

New description:

 I used the following script to print a list of module search paths:
 {{{
 #!/usr/bin/env python

 import sys

 for i in sys.path:
     if not i.startswith('/Users'):
         print i
 }}}

 The result from the py27-virtualenv version of python is as follows:
 {{{
 /private/tmp
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /plat-darwin
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /lib-tk
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /plat-mac
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /plat-mac/lib-scriptpackages
 }}}

 The result from the python27 is as follows:
 {{{
 /private/tmp
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /plat-darwin
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /plat-mac
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /plat-mac/lib-scriptpackages
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /lib-tk
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /lib-old
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /lib-dynload
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages
 }}}

 As you can see, there are a lot of paths missing in the virtualenv version
 resulting in preventing the use of python modules installed via macports
 in conjunction with virtualenv.

--

-- 
Ticket URL: <https://trac.macports.org/ticket/45819#comment:3>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list