7s9n / pyraylib

Python Object Oriented Wrapper for raylib
https://github.com/Ho011/pyraylib
zlib License
18 stars 4 forks source link

getting a library error when I try to import pyraylib #1

Closed michaelkpierce closed 1 year ago

michaelkpierce commented 2 years ago

I'm trying to install raylib with python bindings on a raspberry pi. It appears to install

Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting pyraylib Downloading https://www.piwheels.org/simple/pyraylib/pyraylib-1.0.1-py3-none-any.whl (1.8 MB) |████████████████████████████████| 1.8 MB 230 kB/s
Collecting multipledispatch Downloading https://www.piwheels.org/simple/multipledispatch/multipledispatch-0.6.0-py3-none-any.whl (11 kB) Requirement already satisfied: six in /usr/lib/python3/dist-packages (from multipledispatch->pyraylib) (1.16.0) Installing collected packages: multipledispatch, pyraylib Successfully installed multipledispatch-0.6.0 pyraylib-1.0.1

however when i try to import it I get this error.

import pyraylib Traceback (most recent call last): File "", line 1, in File "/home/pi/.local/lib/python3.9/site-packages/pyraylib/init.py", line 55, in main_path = Path(main_mod.file).parent AttributeError: module 'main' has no attribute 'file'

It shows the module is installed pyparsing xxsubtype binascii graphlib pyray zipapp binhex grp pyraylib zipfile bisect guizero qtconsole zipimport blinker gyp qtpy zlib blinkt gzip queue zmq brain_argparse hashlib quopri zoneinfo brain_attrs heapq rainbowhat
brain_boto3 hmac random

what am I doing wrong here?

Thanks for your help Michael

7s9n commented 2 years ago

I'm trying to install raylib with python bindings on a raspberry pi. It appears to install

Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting pyraylib Downloading https://www.piwheels.org/simple/pyraylib/pyraylib-1.0.1-py3-none-any.whl (1.8 MB) |████████████████████████████████| 1.8 MB 230 kB/s Collecting multipledispatch Downloading https://www.piwheels.org/simple/multipledispatch/multipledispatch-0.6.0-py3-none-any.whl (11 kB) Requirement already satisfied: six in /usr/lib/python3/dist-packages (from multipledispatch->pyraylib) (1.16.0) Installing collected packages: multipledispatch, pyraylib Successfully installed multipledispatch-0.6.0 pyraylib-1.0.1

however when i try to import it I get this error.

import pyraylib Traceback (most recent call last): File "", line 1, in File "/home/pi/.local/lib/python3.9/site-packages/pyraylib/init.py", line 55, in main_path = Path(main_mod.file).parent AttributeError: module 'main' has no attribute 'file'

It shows the module is installed pyparsing xxsubtype binascii graphlib pyray zipapp binhex grp pyraylib zipfile bisect guizero qtconsole zipimport blinker gyp qtpy zlib blinkt gzip queue zmq brain_argparse hashlib quopri zoneinfo brain_attrs heapq rainbowhat brain_boto3 hmac random

what am I doing wrong here?

Thanks for your help Michael

Did you edit the source code ? if you do so , then main_path = Path(main_mod.file).parent should be main_path = Path(main_mod.__file__).parent