无法在Python上导入nodebox.graphics

时间:2016-03-01 18:30:02

标签: python graphics nodebox

我正在尝试将NodeBox for OpenGL用于Python,但我无法在Python 2和3上导入库。

espaco@Arch ~> python2
Python 2.7.11 (default, Dec  6 2015, 15:43:46) 
[GCC 5.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from nodebox.graphics import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/nodebox_opengl-1.6-py2.7.egg/nodebox/graphics/__init__.py", line 1, in <module>
    import bezier
  File "/usr/lib/python2.7/site-packages/nodebox_opengl-1.6-py2.7.egg/nodebox/graphics/bezier.py", line 10, in <module>
    from context import BezierPath, PathElement, PathError, Point, MOVETO, LINETO, CURVETO, CLOSE
  File "/usr/lib/python2.7/site-packages/nodebox_opengl-1.6-py2.7.egg/nodebox/graphics/context.py", line 29, in <module>
    import geometry
  File "/usr/lib/python2.7/site-packages/nodebox_opengl-1.6-py2.7.egg/nodebox/graphics/geometry.py", line 454, in <module>
    from pyglet.gl import \
ImportError: cannot import name pointer
>>> 
espaco@Arch ~> python3
Python 3.5.1 (default, Dec  7 2015, 12:58:09) 
[GCC 5.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from nodebox.graphics import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/site-packages/nodebox_opengl-1.6-py3.5.egg/nodebox/graphics/__init__.py", line 1, in <module>
ImportError: No module named 'bezier'
>>> 

我对Python 2错误没有任何线索,但Python 3对我来说似乎没有意义,因为如果我在库目录上执行tree 我可以看到bezier.py在那里就是这样:

espaco@Arch ~> tree /usr/lib/python3.5/site-packages/nodebox/
/usr/lib/python3.5/site-packages/nodebox/
├── ext
│   ├── __init__.py
│   ├── psyco
│   │   ├── classes.py
│   │   ├── core.py
│   │   ├── __init__.py
│   │   ├── kdictproxy.py
│   │   ├── logger.py
│   │   ├── profiler.py
│   │   ├── __pycache__
│   │   │   ├── classes.cpython-35.pyc
│   │   │   └── logger.cpython-35.pyc
│   │   └── support.py
│   ├── __pycache__
│   │   ├── __init__.cpython-35.pyc
│   │   └── setup.cpython-35.pyc
│   └── setup.py
├── graphics
│   ├── bezier.py
│   ├── context.py
│   ├── geometry.py
│   ├── __init__.py
│   ├── noise.py
│   ├── physics.py
│   ├── __pycache__
│   │   ├── __init__.cpython-35.pyc
│   │   └── noise.cpython-35.pyc
│   └── shader.py
├── gui
│   ├── controls.py
│   ├── __init__.py
│   └── __pycache__
│       └── __init__.cpython-35.pyc
├── __init__.py
├── __pycache__
│   └── __init__.cpython-35.pyc
└── sound
    ├── __init__.py
    ├── osc.py
    ├── process.py
    └── __pycache__
        └── __init__.cpython-35.pyc

11 directories, 31 files

为什么我会收到这些错误?我该如何修理它们?

1 个答案:

答案 0 :(得分:0)

尝试nodebox-opengl 1.6.1 + pyglet-1.3.3