You are not logged in.

#1 2010-11-30 21:06:02

freieschaf
Member
Registered: 2010-11-30
Posts: 18

[SOLVED] Installing pyOpenGL

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

#2 2010-11-30 21:56:54

Foucault
Member
From: Athens, Greece
Registered: 2010-04-06
Posts: 214

Re: [SOLVED] Installing pyOpenGL

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

#3 2010-11-30 22:11:40

freieschaf
Member
Registered: 2010-11-30
Posts: 18

Re: [SOLVED] Installing pyOpenGL

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

#4 2010-11-30 23:01:23

dragonhawk360
Member
Registered: 2010-10-20
Posts: 21

Re: [SOLVED] Installing pyOpenGL

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

#5 2010-11-30 23:20:58

Foucault
Member
From: Athens, Greece
Registered: 2010-04-06
Posts: 214

Re: [SOLVED] Installing pyOpenGL

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.

Last edited by Foucault (2010-11-30 23:23:25)

Offline

#6 2010-11-30 23:24:55

freieschaf
Member
Registered: 2010-11-30
Posts: 18

Re: [SOLVED] Installing pyOpenGL

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

#7 2010-11-30 23:28:32

freieschaf
Member
Registered: 2010-11-30
Posts: 18

Re: [SOLVED] Installing pyOpenGL

Foucault wrote:
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

Board footer

Powered by FluxBB