【问题标题】:Cannot import nodebox.graphics on Python无法在 Python 上导入 nodebox.graphics
【发布时间】:2016-06-14 07:50:26
【问题描述】:

我正在尝试将 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

为什么会出现这些错误?我该如何解决?

【问题讨论】:

标签: python graphics nodebox


【解决方案1】:

试试nodebox-opengl 1.6.1 + pyglet-1.3.3

【讨论】:

    猜你喜欢
    • 2018-03-07
    • 2017-12-20
    • 1970-01-01
    • 1970-01-01
    • 2019-12-28
    • 2018-08-07
    • 2011-06-15
    • 2018-04-17
    • 2020-12-08
    相关资源
    最近更新 更多