PyVRML97需要旧版本的PyOpenGL
我设置了一个虚拟环境,开启了系统包的选项,叫做 vrmlmol
。在这个 vrmlmol
环境里,我用 pip
安装了 yolk
。
这是输出结果 -
(vrmlmol)debanjan@thinkpad:~/vrmlmol$ yolk -V PyOpenGL
PyOpenGL 3.1.0b1
PyOpenGL 3.0.2
PyOpenGL 3.0.1
(vrmlmol)debanjan@thinkpad:~/vrmlmol$ yolk -V PyVRML97
PyVRML97 2.3.0a4
如你所见,PyOpenGL 的 2.x 版本在 PyPI 上是不存在的。当我尝试安装 PyOpenGL 和 PyVRML 时,出现了以下依赖失败的情况:
(vrmlmol)debanjan@thinkpad:~/vrmlmol$ pip install -I PyOpenGL PyVRML97
Downloading/unpacking PyOpenGL
Downloading PyOpenGL-3.0.2.tar.gz (891kB): 891kB downloaded
Running setup.py egg_info for package PyOpenGL
warning: no previously-included files matching '*.odt' found anywhere in distribution
warning: no previously-included files matching '*.odp' found anywhere in distribution
warning: no previously-included files matching '.cvsignore' found anywhere in distribution
warning: no previously-included files matching '*.diff' found anywhere in distribution
warning: no previously-included files found matching 'src/*.h'
warning: no previously-included files found matching 'src/*.xml'
warning: no previously-included files found matching 'src/*.zip'
warning: no previously-included files found matching 'src/*.pdf'
warning: no previously-included files found matching 'src/*.zip'
warning: no previously-included files found matching 'src/*.txt'
warning: no files found matching 'src/win32deps.py'
warning: no files found matching 'src/toglinstall/get_togl.py'
warning: no files found matching 'ChangeLog.txt'
warning: no previously-included files found matching 'OpenGL_accelerate'
Downloading/unpacking PyVRML97
Could not find a version that satisfies the requirement PyVRML97 (from versions: 2.2.0a4, 2.2.0a5, 2.2.0a5, 2.2.0a6, 2.2.0a6, 2.2.0a7, 2.2.0a7, 2.2.0a8, 2.2.0a8, 2.3.0a1, 2.3.0a1, 2.3.0a2, 2.3.0a2, 2.3.0a3, 2.3.0a3, 2.3.0a4, 2.3.0a4)
Cleaning up...
No distributions matching the version for PyVRML97
Storing complete log in /home/debanjan/.pip/pip.log
因为这些包不在,所以我看不到用 pip 安装更新版的 PyVRML 或旧版的 PyOpenGL 的选项。有没有什么帮助呢?我想让我的一些同事能更容易地开始他们自己的设置……所以如果能用 pip 就更好了。
1 个回答
2
这是最近对PIP做出的一些改变导致的副作用,这些改变默认不允许安装alpha或beta版本。PyVRML97的最后一个“正式”版本太旧了,它依赖于PyOpenGL 2.x(这个版本早就过时了,而且现在通过自动工具已经无法从SourceForge获取)。
不幸的是,我一直没有及时发布PyVRML97和OpenGLContext的正式版本,因为我通常把它们当作我个人测试PyOpenGL的环境。在我解决这个问题之前,你需要明确指定alpha版本。
为了绕过这个特定的问题,你需要明确指定PyVRML97的版本:
$ pip install "PyVRML97==2.3.0a4"
如果你想在Python 2.7(在Linux上)安装一个完整、可用的PyVRML97/OpenGLContext环境,并且使用所有包中最新发布的版本,你的命令行应该是这样的:
$ virtualenv oglc-env
$ source oglc-env/bin/activate
(oglc-env)$ pip install PyOpenGL PyOpenGL_accelerate "PyVRML97==2.3.0a4" simpleparse numpy "OpenGLContext==2.2.0a3" pydispatcher pillow
你可能会发现,安装pillow时需要在系统级别安装额外的依赖项(我机器上已经有这些依赖项了)。我刚刚在一台Kubuntu 13.10的机器上测试了安装过程,并运行了一个OpenGLContext的演示脚本。