iminurnamez / pyroller

pygame casino
65 stars 29 forks source link

pymunk included? #59

Closed metulburr closed 9 years ago

metulburr commented 9 years ago
ImportError: No module named 'pymunk'

From reddit, it sounded like pymunk was going to be included in the repo? Are we/users now expected to install another 3rd party module for python 3.x and python2.x? I know how to install it, im just asking why is it not included?

Mekire commented 9 years ago

It will be. Just not quite there yet. We also have temporarily lost py3 compatibility.

bitcraft commented 9 years ago

pygame has the compat module which has the basics needed for python2/3 compatibility. we can use this instead of the six module, or a bunch or rogue hacks all over. we should maybe consider requirements.txt, so that the correct versions of software can be install automatically with pip.

as for pymunk, i've submitted a PR that will include it. tested on window 8.1 and python 2.7.

metulburr commented 9 years ago

I downloaded and ran your repo. I also removed my pymunk install to see if it would run with the pymunk additions. Am i missing somethiing? How does each OS get the required lib?

metulburr@ubuntu ~/Downloads/pyroller-master  $ python pyroller.py -c
Loading chipmunk for Linux (64bit) [/home/metulburr/Downloads/pyroller-master/pymunk/libchipmunk64.so]

Failed to load pymunk library.

This error usually means that you don't have a compiled version of chipmunk in 
the correct spot where pymunk can find it. pymunk does not include precompiled 
chipmunk library files for all platforms. 

The good news is that it is usually enough (at least on *nix and OS X) to 
simply run the compile command first before installing and then retry again:

You compile chipmunk with
> python setup.py build_chipmunk
and then continue as usual with 
> python setup.py install
> cd examples
> python basic_test.py

(for complete instructions please see the readme file)

If it still doesnt work, please report as a bug on the issue tracker at 
https://github.com/viblo/pymunk/issues
Remember to include information about your OS, which version of python you use 
and the version of pymunk you tried to run. A description of what you did to 
trigger the error is also good. Please include the exception traceback if any 
(usually found below this message).

Traceback (most recent call last):
  File "pyroller.py", line 4, in <module>
    from data.main import main
  File "/home/metulburr/Downloads/pyroller-master/data/main.py", line 15, in <module>
    from .states import credits_screen, snake_splash, pachinko
  File "/home/metulburr/Downloads/pyroller-master/data/states/pachinko/__init__.py", line 1, in <module>
    from .pachinko import Pachinko
  File "/home/metulburr/Downloads/pyroller-master/data/states/pachinko/pachinko.py", line 5, in <module>
    from .playfield import Playfield
  File "/home/metulburr/Downloads/pyroller-master/data/states/pachinko/playfield.py", line 7, in <module>
    import pymunk
  File "/home/metulburr/Downloads/pyroller-master/pymunk/__init__.py", line 60, in <module>
    from . import _chipmunk as cp
  File "/home/metulburr/Downloads/pyroller-master/pymunk/_chipmunk.py", line 13, in <module>
    chipmunk_lib = load_library("chipmunk", debug_lib=_lib_debug)
  File "/home/metulburr/Downloads/pyroller-master/pymunk/libload.py", line 74, in load_library
    lib = platform_specific_functions()['library_loader'].LoadLibrary(libfn)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/metulburr/Downloads/pyroller-master/pymunk/libchipmunk64.so: cannot open shared object file: No such file or directory
metulburr@ubuntu ~/Downloads/pyroller-master  $ 

EDIT: Oh i just saw the dll's, should i add the .so for linux 32/64 bit?

metulburr commented 9 years ago

.so removed from .gitignore, problem resolved