rzyns / macvim

Automatically exported from code.google.com/p/macvim
0 stars 0 forks source link

Python path is incorrect on latest snapshot build for 10.6 #413

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is causing issues in my plugins, specifically, gundo. The case I present 
is not a problem, but rather for easy debugging.

What steps will reproduce the problem?
In vim:
python << ENDPYTHON
import sys
print sys.path
ENDPYTHON

What is the expected output? What do you see instead?
Expected (from shell):
$python -c "import sys; print sys.path"
['', 
'/Library/Python/2.6/site-packages/mercurial-1.3.1-py2.6-macosx-10.6-universal.e
gg', '/Library/Python/2.6/site-packages/bpython-0.9.6.2-py2.6.egg', 
'/Library/Python/2.6/site-packages/Pygments-1.3.1-py2.6.egg', 
'/Library/Python/2.6/site-packages/ipython-0.10-py2.6.egg', 
'/Library/Python/2.6/site-packages/pycurl-7.19.0-py2.6-macosx-10.6-universal.egg
', '/Library/Python/2.6/site-packages/smartypants-1.6.0.3-py2.6.egg', 
'/Library/Python/2.6/site-packages/pystache-0.3.1-py2.6.egg', 
'/Library/Python/2.6/site-packages/Markdown-2.0.3-py2.6.egg', 
'/Library/Python/2.6/site-packages/Pycco-0.2.0-py2.6.egg', 
'/Library/Python/2.6/site-packages/Jinja2-2.5.5-py2.6.egg', 
'/Library/Python/2.6/site-packages/docutils-0.8.1-py2.6.egg', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-dar
win', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac
', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac
/lib-scriptpackages', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk',

'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old'
, 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynl
oad', '/Library/Python/2.6/site-packages', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyOb
jC', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2
.8-mac-unicode']

See instead: 
['/usr/local/lib/python26.zip', '/usr/local/lib/python2.6/', 
'/usr/local/lib/python2.6/
plat-darwin', '/usr/local/lib/python2.6/plat-mac', 
'/usr/local/lib/python2.6/plat-mac/l
ib-scriptpackages', '/usr/local/lib/python2.6/../../Extras/lib/python', 
'/usr/local/lib
/python2.6/lib-tk', '/usr/local/lib/python2.6/lib-old', 
'/usr/local/lib/python2.6/lib-d
ynload']

What version of MacVim and OS X are you using (see "MacVim->About MacVim"
and  "Apple Menu->About This Mac" menu items, e.g. "Snapshot 40, 10.5.6
Intel")?
Snapshot 64 on 10.6.8

Please provide any additional information below.
This should be fixed at a deeper level, but in the meantime, here's a 
workaround:
Plop this at the start of your vimrc:

" Python system path fix: Only for MacVim
if has("macunix") && has("python")
python << ENDPYTHON
import sys
sys.path = ['',
  '/Library/Python/2.6/site-packages/mercurial-1.3.1-py2.6-macosx-10.6-universal.egg',
  '/Library/Python/2.6/site-packages/bpython-0.9.6.2-py2.6.egg',
  '/Library/Python/2.6/site-packages/Pygments-1.3.1-py2.6.egg',
  '/Library/Python/2.6/site-packages/ipython-0.10-py2.6.egg',
  '/Library/Python/2.6/site-packages/pycurl-7.19.0-py2.6-macosx-10.6-universal.egg',
  '/Library/Python/2.6/site-packages/smartypants-1.6.0.3-py2.6.egg',
  '/Library/Python/2.6/site-packages/pystache-0.3.1-py2.6.egg',
  '/Library/Python/2.6/site-packages/Markdown-2.0.3-py2.6.egg',
  '/Library/Python/2.6/site-packages/Pycco-0.2.0-py2.6.egg',
  '/Library/Python/2.6/site-packages/Jinja2-2.5.5-py2.6.egg',
  '/Library/Python/2.6/site-packages/docutils-0.8.1-py2.6.egg',
  '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip',
  '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6',
  '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin',
  '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac',
  '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages',
  '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python',
  '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk',
  '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old',
  '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload',
  '/Library/Python/2.6/site-packages',
  '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC',
  '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode']
import site
ENDPYTHON
end

Original issue reported on code.google.com by mywolf...@gmail.com on 25 Apr 2012 at 8:35

GoogleCodeExporter commented 9 years ago
Note: I realize this is an "unofficial" build. If you can't fix it, if you 
could pass this on to alexlovelltroy at github, it'd be much appreciated.

Original comment by mywolf...@gmail.com on 25 Apr 2012 at 8:37

GoogleCodeExporter commented 9 years ago

Original comment by bjorn.winckler@gmail.com on 9 Jun 2013 at 2:27