user595985
user595985

Reputation: 1583

Installing NodeboxOpenGL on windows

Hello I am trying to install and make use of NodeboxOpenGL, the python library so I can create my own graphs with nodes and edges. But I am running into some trouble, starting off at NodeBox OpenGL site. I downloaded NodeBox for OpenGL and then pyglet, I then did easy_install nodebox-opengl. Note I did not do pip install I installed pyglet from pyglet. So now I am thinking its all ready to go. I did a quick check of my c:\python27\Lib\site-packages\ location just be sure the nodebox folder was there, all seems good. I tried the sample program that's on the site

from nodebox.graphics import *
from nodebox.graphics.physics import Flock

flock = Flock(40, 0, 0, 500, 500)
flock.sight = 300

def draw(canvas):
    background(1)
    fill(0, 0.75)
    flock.update(cohesion=0.15)
    for boid in flock:
        push()
        translate(boid.x, boid.y)
        scale(0.5 + 1.5 * boid.depth)
        rotate(boid.heading)
        arrow(0, 0, 15)
        pop()

canvas.fps = 30
canvas.size = 600, 400
canvas.run(draw)

tried to run it, but i keep getting this error

Traceback (most recent call last):
  File "E:\Workspace\ElasticNodes\graph1.py", line 5, in <module>
    from nodebox.graphics import *
  File "E:\Workspace\ElasticNodes\nodebox\graphics\__init__.py", line 1, in <module>
    import bezier
  File "E:\Workspace\ElasticNodes\nodebox\graphics\bezier.py", line 10, in <module>
    from context import BezierPath, PathElement, PathError, Point, MOVETO, LINETO, CURVETO, CLOSE
  File "E:\Workspace\ElasticNodes\nodebox\graphics\context.py", line 29, in <module>
    import geometry
  File "E:\Workspace\ElasticNodes\nodebox\graphics\geometry.py", line 454, in <module>
    from pyglet.gl import \
ImportError: cannot import name pointer

I tried modifying the python script i.e In your script, add the location of NodeBox to sys.path, before importing it: >>> MODULE = '/users/tom/python/nodebox' >>> import sys; if MODULE not in sys.path: sys.path.append(MODULE) >>> import nodebox

But still the same error. I am using Python2.7, running on windows. I am not sure what I am doing wrong. Has anyone got any experience with running this library on windows. What am I doing wrong

Upvotes: 3

Views: 654

Answers (2)

iron.arty
iron.arty

Reputation: 301

Maybe this helps you:

  1. In geometry.py del "pointer" import. Replace pointer(data) to POINTER(data)
  2. I also had another error, so maybe you need add import to "shaders.py": from ctypes import c_uint

Upvotes: 1

patapouf_ai
patapouf_ai

Reputation: 18693

I am having a similar problem with Linux. The Nodebox-opengl site ( http://www.cityinabottle.org/nodebox/ ) says that python 2.5 or 2.6 must be used, so it is possible that the problem is that you are using 2.7.

EDIT: Ok, I installed pyglet first, with pip (and or apt-get, I did both) and I don't get a problem with pyglet. But I still do get other problems.

Upvotes: 0

Related Questions