You are not logged in.
Pages: 1
Hi everyone.
I'm just beginning to use Arch Linux, so maybe there is some basic fact that I am missing. The fact is, I'm trying to develop a project in Python which uses OpenGL. I installed pyOpenGL smoothly via pacman and no problem there, but when I try to use it, it's not there.
Trying to import the module from the compiler gives an ImportError:
>>> import OpengGL.GL
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named OpengGL.GL
I'm working on Eclipse and similar thing happens there: the import OpenGL in my files gives no error, as OpenGL is present in Forced builtins, but any call to a function from OpenGL in my code generates an 'Undefined variable' error.
I've been looking everywhere and didn't found any similar proble, so any help would be appreciated:)
Last edited by freieschaf (2010-11-30 23:28:56)
Offline
You are probably using python 3. I suppose the opengl bindings are still python 2 so point your interpreter in Eclipse to point to python2 instead of just python (which is python3, default for Arch).
Last edited by Foucault (2010-11-30 21:58:23)
Offline
Thanks for the fast answer:)
But I think that's not the problem, I'm using Python 2.6.5 and Eclipse points to python2.6. Which I don't really understand is if, as you say, the default version of Python in Arch is 3, why do I have v2.6? It was also installed from the repository simply by 'pacman -S python'.
Offline
If you install the 'python' package, you get version 3. 'python2' is the package for version 2.*
Arch i686 + KDE4
"I Write Programs, Not Excuses" - Panic! at the Kernel
Offline
Thanks for the fast answer:)
But I think that's not the problem, I'm using Python 2.6.5 and Eclipse points to python2.6. Which I don't really understand is if, as you say, the default version of Python in Arch is 3, why do I have v2.6? It was also installed from the repository simply by 'pacman -S python'.
Well if eclipse points to python 2.6 then still this does not solve your problem since python-opengl from the repos (if I understood correctly this should be the package you are using) is configured to be used with python 2.7 (check the file list here, you'll notice that it's being installed into /usr/lib/python2.7). So, I think you have two options now 1) Use python2.7 2) rebuild the python-opengl package to be used with python2.6.
Last edited by Foucault (2010-11-30 23:23:25)
Offline
Well, I did have Python version 2.6.5 installed, maybe I typed python2 when I did and didn't remember...
Anyway, your post led me to test that and I unistalled (after removing some packages that needed version 2, among them pyOpenGL) and reinstalled python and, yes, now it was version 3. After that, a new install of pyOpenGL, which, as Foucault said, binds version 2, so this one got installed too. And voilà, it's working. Not sure of what exactly was wrong, but feels good:)
Thanks to you both for your ideas.
Offline
freieschaf wrote:Thanks for the fast answer:)
But I think that's not the problem, I'm using Python 2.6.5 and Eclipse points to python2.6. Which I don't really understand is if, as you say, the default version of Python in Arch is 3, why do I have v2.6? It was also installed from the repository simply by 'pacman -S python'.Well if eclipse points to python 2.6 then still this does not solve your problem since python-opengl from the repos (if I understood correctly this should be the package you are using) is configured to be used with python 2.7 (check the file list here, you'll notice that it's being installed into /usr/lib/python2.7). So, I think you have two options now 1) Use python2.7 2) rebuild the python-opengl package to be used with python2.6.
Well, then that was the problem. Needed v2.7 and was using v2.6... Thanks man.
Offline
Pages: 1