Home Download Buy Blog Forum Support

Clang : can't install ctypes

Clang : can't install ctypes

Postby dbabo on Fri Aug 17, 2012 2:21 am

Hello,
i tried to install clang and ( as expected ) it came with the warning that it can't import ctypes. Pointing to the workaround (http://sublimetext.userecho.com/topic/8 ... -in-linux/).
the first step in there is:
Go to the python console and type "import ctypes" in build 2139 and you'll get:

>>> import ctypes
Traceback (most recent call last):
File "<string>", line 1, in <module>
File ".\ctypes\__init__.py", line 10, in <module>
ImportError: No module named _ctypes


But on my machine the system wide python behavies differently:
Code: Select all
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
>>>


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
dbabo
 
Posts: 25
Joined: Tue Jun 26, 2012 1:47 pm

Re: Clang : can't install ctypes

Postby dbabo on Sat Aug 18, 2012 6:36 pm

any help/advise please ?
dbabo
 
Posts: 25
Joined: Tue Jun 26, 2012 1:47 pm

Re: Clang : can't install ctypes

Postby fshp on Mon Aug 20, 2012 8:11 am

Create symbol link.

sudo ln -s /usr/lib/python2.6 /usr/lib/sublime-text-2/lib/python2.6
fshp
 
Posts: 3
Joined: Thu Aug 16, 2012 2:05 pm

Re: Clang : can't install ctypes

Postby fshp on Mon Aug 20, 2012 8:13 am

Sublime has a minimal python distribution. It is situated in python26.zip. And you need the full version.
fshp
 
Posts: 3
Joined: Thu Aug 16, 2012 2:05 pm

Re: Clang : can't install ctypes

Postby anatolik on Mon Aug 20, 2012 7:09 pm

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..
anatolik
 
Posts: 4
Joined: Wed Aug 15, 2012 2:36 pm

Re: Clang : can't install ctypes

Postby dbabo on Tue Aug 21, 2012 2:16 am

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


that didn't work - first they put python26.zip in, not the not the actual executable.
Here is the output from console:
Code: Select all
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 :
Code: Select all
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 http://www.sublimetext.com/forum/viewtopic.php?f=3&t=7934
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 :)
dbabo
 
Posts: 25
Joined: Tue Jun 26, 2012 1:47 pm

Re: Clang : can't install ctypes

Postby jchadwick on Thu Dec 20, 2012 7:52 pm

A potential solution for the import urandom problem.

Sorry, just wanted to make sure people landing here from Google see this.
jchadwick
 
Posts: 2
Joined: Thu Dec 20, 2012 7:49 pm


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot] and 24 guests