electronstudio / raylib-python-cffi

Python CFFI bindings for Raylib
http://electronstudio.github.io/raylib-python-cffi
Eclipse Public License 2.0
152 stars 29 forks source link

issue with running example from the fork reposetory #81

Closed sDos280 closed 2 years ago

sDos280 commented 2 years ago

I cloned that raylib-python-cffi repository into my pc but when I try to run the example I get that error. I think the problem is that when I use the "from pyray import *" line it tries to import the pyray package that is provided with the repository and not with the pyray package that is installed on the appdata\roaming\python\python310\site-packages folder. does anyone know how to fix that? image

electronstudio commented 2 years ago

It depends how you have setup your module search path, venv, if you are using an IDE, etc. By default, running from the command line, Python will check for the module examples/shapes/pyray. Assuming it doesn't find that, it will check site-packages/pyray and use that one.

sDos280 commented 2 years ago

I am editing and running my files via pycharm, is there a way to explicitly tell it to use site-packages/pyray?

electronstudio commented 2 years ago

There probably is, but I don't know. You could just delete raylib-python-cffi/pyray folder and then Pycharm will be unable to use that.

sDos280 commented 2 years ago

ok, I tested that and I just needed to remove the raylib-python-cffi/pyray and the raylib-python-cffi/raylib. thanks :).

I have another question, why did I get the error when I tried to run it with the raylib-python-cffi/pyray and the raylib-python-cffi/raylib? like why would I get that error? isn't that folder should be the same as the one on the site-packages/pyray?

image

electronstudio commented 2 years ago

It's because you haven't compiled the module. To do that you would do python raylib/build.py. But you're on Windows, so compiling is difficult, so I didn't suggest it as solution.

sDos280 commented 2 years ago

ok, thanks for helping 🙃