Sublime Forum

Clang : can't install ctypes

#1

Hello,
i tried to install clang and ( as expected ) it came with the warning that it can’t import ctypes. Pointing to the workaround (sublimetext.userecho.com/topic/8 … -in-linux/).
the first step in there is:

But on my machine the system wide python behavies differently:

[code]which python
/usr/bin/python
[az@server src]$ python
Python 2.6.6 (r266:84292, Jun 18 2012, 09:57:52)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import ctypes

[/code]

It is my understanding the Editor has a problem with python.

Question:
how do i make the use of system installed python?

Thank you
Andrew

0 Likes

#2

any help/advise please ?

0 Likes

#3

Create symbol link.

sudo ln -s /usr/lib/python2.6 /usr/lib/sublime-text-2/lib/python2.6

0 Likes

#4

Sublime has a minimal python distribution. It is situated in python26.zip. And you need the full version.

0 Likes

#5

I also have a pain installing SublimeClang on Ubuntu x64…

Should Sublime use the default system python first? In this case if Python is already installed (I believe this is majority of users) then plugins can use full power of python (including ctypes). Otherwise Sublime should use the internal minimal version of python but most plugins will still be usable…

Also why sublime uses python 2.6 and not 2.7? For example Ubuntu ships 2.7 by default…

0 Likes

#6

that didn’t work - first they put python26.zip in, not the not the actual executable.
Here is the output from console:

libgio version is less than 2.26, single instance support disabled PackageSetup not required Py_GetProgramName(): sublime_text Py_GetExecPrefix(): . Py_GetProgramFullPath(): Py_GetPath(): ./lib/python26.zip:./lib/python2.6/:./lib/python2.6/plat-linux2:./lib/python2.6/lib-tk:./lib/python2.6/lib-old:./lib/python2.6/lib-dynload Py_GetPythonHome(): . catalogue loaded found 5 files for base name Default.sublime-keymap found 2 files for base name Default.sublime-mousemap found 3 files for base name Main.sublime-menu Traceback (most recent call last): File "./sublime_plugin.py", line 1, in <module> import os ImportError: No module named os
What (partially) worked is :

ln -s /usr/lib64/python2.6 python2.6

but that’s not a 100% good either - i ended up with the same problem as knifter https://forum.sublimetext.com/t/sublimes-python2-6-no-virtualenv-import-urandom-error/6242/1
And i agree with him about maintaining yet another install of the python just for this app… Doesn’t make a lot of sense to me.

Would be nice to see this fixed already, but based on the stats - i doubt author(s) will ever get to this. Until then i’ll use other means to edit files :smile:

0 Likes

Sublimes python2.6, no virtualenv, import urandom error
#7

A potential solution for the import urandom problem.

Sorry, just wanted to make sure people landing here from Google see this.

0 Likes