Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Polarweb Help
noahcolema-
n
Newbie
Posts: 4
Permalink
Post Polarweb Help
on: October 15, 2014, 02:24
Quote

Hey everyone, I am trying to do a similar project to Sandy's setup at the Edinburgh Science Festival--namely a polargraph that sources its own images and draws them ad infinitum. I forked the polarweb repo and I think I've installed all the dependencies (I've never done anything with Python before), and when I try to run "app.py" in the terminal, I get the following error:

Noahs-MacBook-Pro-2:polarweb Noah$ python app.py
Traceback (most recent call last):
  File "app.py", line 7, in <module>
    from polarweb.models.geometry import Rectangle
ImportError: No module named polarweb.models.geometry

Any insights or help would be appreciated.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Polarweb Help
on: October 15, 2014, 23:13
Quote

Hello! Welcome, I think you're the first to pick up polarweb since I wrote it!

Your problem is a PYTHONPATH issue. PYTHONPATH is an environment variable that controls where python will look for it's modules.

So on [line 7](https://github.com/euphy/polarweb/blob/master/polarweb/app.py#L7) of app.py, the import statement says to find polarweb.models.geometry, so it needs to know where to find the polarweb module first. python is dumb enough that it doesn't think to look in the current folder, so you've got to tell it.

http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7

The link above has a few ways to do it, but I did it just now by using the environment variables box in Windows, adding a new variable called pythonpath, with the value "C:\workspace\pycharmprojects\polarweb".

Then in a terminal,

  
  cd C:\workspace\pycharmprojects\polarweb
  python polarweb/app.py

... which runs, but gives you a fairly royal dismissal with an error. I've left this in a bit of a state, so you'll have to give me some time to whip it back into working shape. I'll see what I can do in the next couple of days - sorry about that.

I have created a tag (a release) in github at a point where I think this worked last -https://github.com/euphy/polarweb/releases/tag/0.1.0 so try branching from there. I can get it running using that code ... not so much with the head.

Good luck!
sn

noahcolema-
n
Newbie
Posts: 4
Permalink
Post Re: Polarweb Help
on: October 17, 2014, 17:42
Quote

Thanks for the quick reply! I will try to change my PYTHONPATH. I'm on a Mac, but I found a few Stack Overflow threads for adding to the PYTHONPATH on a Mac. I'll also try running your tag. Thanks again for all your help.

kwaxtel
Newbie
Posts: 1
Permalink
Post Re: Polarweb Help
on: November 15, 2015, 22:26
Quote

Hi Sandy,
I tried setting the PYTHONPATH to the path of the project, but I am still getting the same error mentioned by Noah. Could you please detail the steps required to alleviate this issue? I am running the app.py file from the terminal on Mac OSX. Noah, did you find a solution?

krummrey
Advanced
Posts: 66
Permalink
Post Re: Polarweb Help
on: November 25, 2015, 14:53
Quote

I've also tried to get it to run on a Raspberry Pi, so I can draw without my laptop.
The first errors form line 7 to 9 I resolved by installing the modules with pip. When getting to line 10 I set the PYTHONPATH to the source directory:

export PYTHONPATH=~/Downloads/polarweb

But that didn't do the trick. Still getting the

Traceback (most recent call last):
  File "polarweb/app.py", line 10, in <module>
    from polarweb import config
ImportError: No module named polarweb

Hope to get it running that way. Processing3 for the Pi won't run the PolargraphController and would probably too slow anyhow.

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Polarweb Help
on: November 27, 2015, 23:01
Quote

I should make it clear that Polarweb is _not_ a drop-in replacement for the Processing app. It does a very different thing, in a very different way, and will require some good programming chops to get it do simple stuff like draw an SVG.

If you solve your own pythonpath problems, you might have luck getting it to do what you want because you got the skills 🙂

The Processing app only runs in Processing 2.2.1. It will be a dog on the Pi, if you can even get it running. Wrong tool for the job.

sn

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.017 seconds.