我试图在Python中使用NodeBox for OpenGL,但是我无法在Python2和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'
>>> 我不知道Python2的错误,但是Python3One对我来说似乎是荒谬的,因为如果我在库目录bezier.py 上做了一个tree,我可以在那里看到:
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我为什么要犯这些错误?我怎样才能修好它们?
发布于 2020-02-23 19:32:04
试试nodebox-opengl 1.6.1 + pyglet-1.3.3
https://stackoverflow.com/questions/35730631
复制相似问题