【问题标题】:Sublimetext2 Installation on Mac OS X 10.7.4Mac OS X 10.7.4 上的 Sublime Text 2 安装
【发布时间】:2012-06-14 17:01:31
【问题描述】:

我正在尝试安装 SBT2 并进行以下设置

操作系统

Mac OS X 10.7

tbc:~ mystic$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
tbc:~ mystic$ python -V
Python 2.7.2

我从 SBT2 网站下载了 dmg 包并安装它,但打开 SBT2 应用程序后出现错误

Unable to run package setup:

Failed to load module

Traceback (most recent call last):
  File "./PackageSetup.py", line 7, in <module>
    import zipfile
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/zipfile.py", line 4, in <module>
    import struct, os, time, sys, shutil
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/struct.py", line 1, in <module>
    from _struct import *
ImportError: No module named _struct

根据 sublimetext2 论坛帮助我还尝试了什么

tbc:~ mystic$ ls -la /Library/Frameworks/Python.framework/Versions
total 8
drwxr-xr-x 5 root admin 170 Jun 12 2011 .
drwxr-xr-x 6 root admin 204 Jun 12 2011 ..
drwxrwxr-x 11 root admin 374 Jun 12 2011 2.7
drwxrwxr-x 10 root admin 340 Jun 9 2011 3.0
lrwxr-xr-x 1 root admin 3 Sep 25 2011 Current -> 2.7
tbc:~ mystic$ cd /Library/Frameworks/Python.framework/Versions
tbc:Versions mystic$ sudo rm Current
Password:
tbc:Versions mystic$ sudo ln -s /Library/Frameworks/Python.framework/Versions/2.7 Current

因为我默认使用 Python2.7,所以我不知道为什么 SBT2 会追随 Python2.6

据我所知,它不应该这么复杂,但是没有办法让它发挥作用。

感谢任何帮助和建议!

【问题讨论】:

    标签: installation osx-lion sublimetext


    【解决方案1】:

    我遇到同样的问题。花了很多时间研究它的配置文件或 plist 后,我​​什么也没得到。

    然后我找到了一些技巧来欺骗 Sublime Text 2 使用 python 2.7 而不是 2.6

    cd /Library/Frameworks/Python.framework/Versions/
    sudo mv 2.6 2.6-backup
    sudo ln -s 2.7 2.6
    

    这对我有用。

    【讨论】:

    • 运气好吗?有任何问题,请告诉我。
    • ln -s 2.7 2.6 权限被拒绝
    • 你需要使用 sudo 来运行它。 “须藤 ln -s 2.7 2.6”
    猜你喜欢
    • 2013-11-03
    • 2015-02-25
    • 1970-01-01
    • 2012-07-16
    • 2012-05-20
    • 2012-10-21
    • 2014-03-13
    相关资源
    最近更新 更多