rzyns / macvim

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

Python: ImportError: No module named os #392

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

$ vim
:python print 2+2 # works fine
:python import sys # 'import site' failed; use -v for traceback
:python print sys.version # 2.6.1 (r261:67515…
:python import os # ImportError: No module named os

I'm using:

- Mac Os X 10.6.8
- Vim 7.3.353
- MacVim 7.3 (63)

To install MacVim, I used Homebrew and modified the recipe to compile with 
--with-macarchs=i386.

Thanks!

Original issue reported on code.google.com by charlesa...@gmail.com on 2 Dec 2011 at 4:03

GoogleCodeExporter commented 9 years ago
This sounds like a problem with mismatched Python versions and not a bug in 
MacVim.  Please take it up on the vim_mac Google group.  Thanks.

Original comment by bjorn.winckler@gmail.com on 2 Dec 2011 at 5:15

GoogleCodeExporter commented 9 years ago
I removed all my homebrew installed python, did `pythonbrew off`, removed 
macvim and reinstalled it with homebrew using system python. It now works.

Original comment by charlesa...@gmail.com on 2 Dec 2011 at 5:15

GoogleCodeExporter commented 9 years ago
OK, glad you figured it out.  These things can be very finicky.

Original comment by bjorn.winckler@gmail.com on 2 Dec 2011 at 5:40

GoogleCodeExporter commented 9 years ago
I experienced trouble with MacVim (snapshot-64) installed with home brew.  In 
particular, all open windows would be closed upon:

1) running ":python print 2+2"
2) opening certain python file from my site-packages folder

My fix, after reading issue 370 and issue 392 was the following:

brew unlink python;
brew unlink macvim; 
brew install -v --force macvim; 
brew link macvim; 
brew link python

My problems have disappeared.  Also, it appears to be 64-bit.   E.g.:

:python import sys; print sys.maxint
> 9223372036854775807

Thanks,
- S.

Original comment by stu.andrews on 13 Jan 2012 at 11:09

GoogleCodeExporter commented 9 years ago
same situation for me as in Comment 4. The sequence of commands that fixed this 
for me was:

brew unlink python
brew unlink macvim
brew remove macvim
brew install -v --force macvim
brew link macvim
brew link python

Original comment by orl...@gmail.com on 5 Sep 2012 at 6:35