Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get it running on Mac #1

Open
adius opened this issue Dec 16, 2014 · 12 comments
Open

Can't get it running on Mac #1

adius opened this issue Dec 16, 2014 · 12 comments

Comments

@adius
Copy link

adius commented Dec 16, 2014

I installed the dependencies (but using pillow instead of PIL) and then run the installation script with $ ./install.sh.
When I try to execute the script with $ ./build/scripts-2.7/snowflake.py, I get following error message:

Traceback (most recent call last):
  File "app_main.py", line 75, in run_toplevel
  File "./build/scripts-2.7/snowflake.py", line 5, in <module>
    from sfgen import *
  File "/usr/local/Cellar/pypy/2.4.0_2/libexec/site-packages/sfgen/__init__.py", line 21, in <module>
    from graphics import *
  File "/usr/local/Cellar/pypy/2.4.0_2/libexec/site-packages/sfgen/graphics.py", line 18, in <module>
    from PIL import Image
ImportError: No module named PIL
@adius
Copy link
Author

adius commented Dec 16, 2014

…and I can't get PIL installed (which is not very surprising in light of not having been updated since 2009). But using pillow instead of PIL seems to be the best practice anyway…

@vishnubob
Copy link
Owner

Hi Adius. Yeh, pillow is the money, since PIL is no longer maintained and they are 100% compatible. As you can see, you are the first person to report an issue. I'm curious, how did you find out about this repo? Are you interested in cutting your own snowflakes?

@roryk
Copy link

roryk commented Dec 16, 2014

Hi Adius,

If you install the anaconda distribution of python like this:

wget http://09c8d0b2229f813c1b93-c95ac804525aac4b6dba79b00b39d1d3.r79.cf1.rackcdn.com/Anaconda-1.9.2-MacOSX-x86_64.sh
bash Anaconda-1.9.2-MacOSX-x86_64.sh
conda install pip
conda install distribute

You can install PIL with conda install PIL, and then you should be good to go!

@adius
Copy link
Author

adius commented Dec 17, 2014

@vishnubob Well, I want to lasercut snowflakes and so I searched for snowflake generator on github and found your repo. =)

@roryk I'd rather only use homebrew and I already installed all the necessary dependencies with homebrew so it should work. The question now is: why not? =P

@roryk
Copy link

roryk commented Dec 17, 2014

Gotcha, as a last sell: conda is awesome because it solves this exact problem. PIL doesn't compile out of the box because it has been deprecated and isn't well maintained but conda provides binaries for all of the hard to compile things. It just installs into a ~/anaconda directory in your home directory, so if you don't like it you can just delete the directory and that's it.

@adius
Copy link
Author

adius commented Dec 17, 2014

I guess it won't get easier then brew install pillow and brew uninstall pillow ;-)

@roryk
Copy link

roryk commented Dec 17, 2014

True. :) The script looks like it is using pypy as the interpreter by default, which is using it's own site-packages that pillow is not in, maybe? If you run:

python build/scripts-2.7/snowflake.py

does it work?

@vishnubob
Copy link
Owner

snowflake uses pypy because it simulates a closed dynamic system at a mesoscopic scale. using straight python to generate your snowflake will take days, but with pypy, it will only take hours. i don't use anaconda, so i can't directly speak to its utility, but i can make some suggestions based on how i setup my environment. first, you will want to install pypy. use virtualenv to setup a virtual environment, pointing to pypy as the interpreter (virtualenv -p /path/to/pypy). switch to that environment, and use pip to install pillow.

@adius
Copy link
Author

adius commented Dec 17, 2014

@roryk Ah, this seems to be the problem! I can make it work with python. =)

Can you maybe add some example configurations to the README? I tried some configurations but couldn't really figure out which one are allowed and which are not…

@vishnubob
Copy link
Owner

if you are looking for a quicker simulation time, i recommend you use pypy for the simulations, but if you have the time, python will work fine.

as far as examples and documentation goes, i just don't have time right now. i wrote this as a one-off project a few years back, and haven't had the chance to circle around and improve it; but feel free to submit pull requests.

@adius
Copy link
Author

adius commented Dec 19, 2014

OK, too bad, this is a really cool project!
Maybe next year I'll have a closer look … this year I simply retraced your PNGs with potrace. =P
But I got some really nice lasercut wooden snowflakes now. =)

@seanth
Copy link

seanth commented Dec 12, 2016

Necro, but I just got things working on mac os 10.12. The following assume you have homebrew installed:

brew install numpy
brew install pillow
brew install pypy
pypy -m pip install git+https://bitbucket.org/pypy/numpy.git
pypy -m pip install pillow

That should correctly install everything. The newest version of pillow removed a call used in graphics.py, and I put in a pull request to fix it (#2)

In my tests, I can make snowflake images using the python or pypy method. I am not set up to test the 3dprinting or laser cutting though. Pretty simple test is:

pypy snowflake.py -b -V -M 49 testflake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants