PyOpenGL glutInit NullFunctionError

前端 未结 11 1780
梦如初夏
梦如初夏 2020-11-30 05:13

I am running Anaconda Python 2.7 on a Win7 x64 machine and used

pip install PyOpenGL PyOpenGL_accelerate

at the Anaconda command line to i

相关标签:
11条回答
  • 2020-11-30 05:30

    Yes, this happened to me on Windows 10 running python 2.713 anaconda 4 64 bit. I had used conda to install pyopengl but received the same error as above. So I downloaded freeglut from transmissionzero and just copied the freeglut.dll (64 bit for me) to the same directory as my source file (it just needs to be in the dll searchpath) and all was good.

    0 讨论(0)
  • 2020-11-30 05:34

    On linux, the pyopengl module attempts to use ctypes module to load the glut library as simply 'glut'. According to ctypes documentation the loadLibrary routine must be given the complete filename. Therefore, I made a symbolic link to libglut.so and named it 'glut' and everything just worked.

    0 讨论(0)
  • 2020-11-30 05:35

    For people on Linux with this error after installing via easy_install PyOpenGL or pip install PyOpenGL.

    -> Install the distribution package as: sudo apt-get install python-opengl - this works for me.

    0 讨论(0)
  • 2020-11-30 05:39

    The following command should work for Anaconda users:

    conda install -c conda-forge freeglut

    https://anaconda.org/conda-forge/freeglut

    0 讨论(0)
  • 2020-11-30 05:40

    for python 2.7, PyopenGL needs vc++ 9 compiler, download and install it.

    then:

    python -m pip install --upgrade pip
    
    pip install image
    
    pip install numpy
    
    pip install PyOpenGL PyOpenGL_accelerate
    

    I downloaded freeglut

    unzipped it and added bin directory to the path when calling: glutCreateWindow("sometitle") changed to glutCreateWindow(b'sometitle')

    and got it run on windows 7

    0 讨论(0)
提交回复
热议问题