简体   繁体   English

安装 PyOpenGLContext 时遇到问题(语法错误)

[英]Trouble Installing PyOpenGLContext (Syntax Error)

I've recently decided to learn OpenGl in python.我最近决定在 python 中学习 OpenGl。

I installed PyOpenGL using pip3 install PyOpenGl PyOpenGl_accelerate .我使用pip3 install PyOpenGl PyOpenGl_accelerate I was then about to follow a tutorial for PyOpenGL.我当时正准备学习 PyOpenGL 的教程 The first item was to install PyOpenGLContext.第一项是安装 PyOpenGLContext。

I tried to install PyOpenGLContext with both pip3 install OpenGLContext and pip3 install PyDispatcher PyVRML97 OpenGLContext and both gave me the same error:我尝试使用pip3 install OpenGLContextpip3 install PyDispatcher PyVRML97 OpenGLContext并且都给了我同样的错误:

    Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/3r/xfny397j6j98y1sjgh_s574m0000gn/T/pip-build-o7zx54vx/OpenGLContext/setup.py", line 10
    except ImportError, err:
                      ^
SyntaxError: invalid syntax

So, there's a syntax error there.所以,那里有一个语法错误。 How do I get around this?我该如何解决这个问题? If you need more information, please let me know.如果您需要更多信息,请告诉我。 I am trying to install this on a MacBook Pro (2013) version for Python3.5.我正在尝试将它安装在适用于 Python3.5 的 MacBook Pro(2013)版本上。

It should work if you download and install the wheel from Unofficial Windows Binaries for Python Extension Packages :如果您从Unofficial Windows Binaries for Python Extension Packages下载并安装轮子,它应该可以工作:

  1. Download the OpenGLContext‑2.3.0‑py2.py3‑none‑any.whl installation file to a an arbitrary directory.OpenGLContext‑2.3.0‑py2.py3‑none‑any.whl安装文件下载到任意目录。
  2. cd to that directory in a command line and install using pip install OpenGLContext‑2.3.0‑py2.py3‑none‑any.whl在命令行中cd到该目录并使用pip install OpenGLContext‑2.3.0‑py2.py3‑none‑any.whl

It looks like OpenGLContext has not been updated in a while, and thus is not compatible with Python 3.5.看起来 OpenGLContext 已经有一段时间没有更新了,因此与 Python 3.5 不兼容。

Having a look at https://pypi.python.org/pypi/OpenGLContext yields that the last update was in 2014.看看https://pypi.python.org/pypi/OpenGLContext 会发现最后一次更新是在 2014 年。

You probably want to either use an older python version, or a different library.您可能想要使用较旧的 Python 版本或不同的库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM