Install raylib - error

apt list python3.9
apt list pkg-config
sudo apt install pkg-config −− if not installed already
apt list python3-pip -a
sudo apt install python3-pip −− perhaps solving your issue now
python3 -m pip install --upgrade pip
python3 -m pip uninstall raylib
python3 -m pip install -U pip setuptools
pip show setuptools packaging cffi pycparser raylib

Those packages with: WARNING: Package(s) not found: output you’ll need to install and hope that something from above helps on your system, but still not sure:
python3 -m pip install cffi
python3 -m pip install pycparser
python3 -m pip install raylib

Related link is here: https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux#build-raylib-using-cmake.

As well, you might wish to ask pip to build from source:
pip3 install --no-binary raylib --upgrade --force-reinstall raylib

1 Like

this is the log of mine when following your inputs step by step (when they were necessary)

1 Like

This is very kind overview of yours but as I’m not currently running PureOS cannot help further (although I might take a look through again). Anyway I do hope that someone else will help with those errors, provided within your post. Also and in the meantime you might decide to refer to and use this official guidance, including: “Building for wayland requires the following additional packages”.

Edit: As below might help, hopefully and even before above advice:
python3 -m pip install pyray
python3 -m pip install inflection
python3 -m pip install pycparser
python3 -m pip install raylib==4.0.0.6

1 Like

the following commands were accepted
python3 -m pip install pyray
python3 -m pip install inflection
python3 -m pip install pycparser
but
python3 -m pip install raylib==4.0.0.6
not.

I might look into the raylib manual build this weekend but cannot promise if I succeed.

1 Like

No need (will not help you to succeed, as problem is user related, I think), but as first “thing” here (as usually have other things to do and Librem 5 wasn’t in my mind at all), I’m sorry but thought all the way, until now, that your OP is categorized under PureOS and not here. Therefore, sorry again, I just took my Librem 5 phone to check your postings again and found out following after: (sudo) apt install python3-pip and by forgetting to exit:


As side note (as pictured): besides installing raylib-4.0.0.6, without any errors, added packages were: cffi-1.15.0, inflection-0.51 and pycparser-2.21.

Now I typed: (sudo) python3 -m pip uninstall raylib and exit but after typing: python3 -m pip install raylib, as regular user, got only successfully installed raylib in version: 2.6.0 (raylib-2.6.0), by several downgrade errors. Those errors I’m not posting here but they confirm your postings and add new light, sort of, to the related installing issue (as you described already):


@wednesday please go through those steps by yourself:
sudo python3 -m pip install raylib
sudo python3 -m pip uninstall raylib
python3 -m pip install raylib

Afterwards move toward resolving your current purism@pureos user rights in relationship toward raylib as I cannot help for now any further (need to focus on something else but would be glad to learn how you solved this issue). Let me step out, but still hope that this post of mine helped somehow.

@wednesday, I have no time today, yet please consider following/further steps, toward solution, as first ones (before even installing raylib), as kindly described within this thread:

1 Like

I first followed the change-username.service with ease and then succesfully ran
sudo python3 -m pip install raylib
sudo python3 -m pip uninstall raylib
but
python3 -m pip install raylib
gave me the same error as in OP of this thread. :no_mouth:

1 Like

Currently I have no other idea, perhaps next release helps with this issue, as latest available one is problematic as well (with regular user):
python3 -m pip install raylib==4.0.1.0.dev0

EDIT: Perhaps you would like to use raylib for what is intended just with:
sudo python3 -m pip install raylib

Please let us know if adding sudo solved your intentions, actually purpose for what raylib is made.

1 Like

using sudo results with

myusername@pureos:~$ sudo python3 -m pip install raylib
Collecting raylib
Using cached raylib-4.0.0.6-cp39-cp39-linux_aarch64.whl
Requirement already satisfied: inflection in /usr/local/lib/python3.9/dist-packages (from raylib) (0.5.1)
Requirement already satisfied: cffi>=1.14.6 in /usr/local/lib/python3.9/dist-packages (from raylib) (1.15.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.9/dist-packages (from cffi>=1.14.6->raylib) (2.21)
Installing collected packages: raylib
Successfully installed raylib-4.0.0.6

then if I try to run the game

myusername@pureos:~$ python3 game.py
Traceback (most recent call last):
File “/home/myusername/Desktop/game.py”, line 2, in
from raylib import *
File “/usr/local/lib/python3.9/dist-packages/raylib/init.py”, line 15, in
from ._raylib_cffi import ffi, lib as rl
ModuleNotFoundError: No module named ‘raylib._raylib_cffi’

Either same or very similar error explained here: https://githubmemory.com/repo/electronstudio/raylib-python-cffi/issues/29. Looks to me like still not solved for Linux users (although posted 10 months ago).

funny how it’s been fixed for windows users but not for us linux users…it should be the other way around :thinking:

1 Like

As related to the content of my previous post link: “but I expect that won’t work unless you have Visual Studio setup”, you might follow what kindly described here and:
curl -L https://aka.ms/linux-arm64-deb > code_arm64.deb
sudo apt install ./code_arm64.deb

In addition (or just as other choice), this link: https://code.visualstudio.com/docs/?dv=linuxarm64_deb will download code package for arm64 as well and perhaps helps for what intended here:
cd /home/current_user/code_download_directory
sudo dpkg -i code_1.66.2-1649663260_arm64.deb

Not sure if its related, but whenever I used sudo with pip it was suggested I use sudo -H pip install .

1 Like

ok, so I ran
curl -L https://aka.ms/linux-arm64-deb > code_arm64.deb
sudo apt install ./code_arm64.deb
and now I see code_arm64.deb in /home then reran the game with same error.

Now, should I do
curl https://code.visualstudio.com/docs/?dv=linuxarm64_deb
cd /home/username/code_download_directory
sudo dpkg -i code_1.66.2-1649663260_arm64.deb
?

Cannot confirm but it looks like that code package is not related to the raylib issue, therefore please:
sudo apt purge code

Second option would bring the very same error, I guess. Perhaps someone needs to take initiative and contact raylib developers or we will just wait for the next released package.

Also go ahead and execute following, as @Gavaudan kindly recommended:
sudo python3 -m pip uninstall raylib
sudo -H python3 -m pip install raylib

1 Like

results with
Requirements already satisfied: raylib in . . .

1 Like

Yes, this is normal. Now please reran the game (after sudo -H …).

Sorry, forgot to add that I still get the same error, which is

myusername@pureos:~$ python3 game.py
Traceback (most recent call last):
File “/home/myusername/Desktop/game.py”, line 2, in
from raylib import *
File “/usr/local/lib/python3.9/dist-packages/raylib/init.py”, line 15, in
from ._raylib_cffi import ffi, lib as rl
ModuleNotFoundError: No module named ‘raylib._raylib_cffi’

Does the game if you run it with sudo?

sadly not.