我正在尝试将NodeBox 用于 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
为什么我会收到这些错误?我该如何修复它们?