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

installing ACME in RPI 32bit - dependency error - tree-sitter-languages #165

Open
Alan888-dev opened this issue Sep 25, 2024 · 20 comments
Open

Comments

@Alan888-dev
Copy link

Hello,
I have been trying to install ACME in a 32 bit RPI but it fails because of (at least) dependency related with

tree-sitter-languages==1.10.2

Is there any docker/container image we can use in 32 bit RPI or any solution to overcome the installing error?

Thank you.

A.

@ankraft
Copy link
Owner

ankraft commented Sep 25, 2024

I am sorry, but sometimes the dependencies change their requirements. Especially "tree-sitter-languages" depends on a lot of other repositories.

Could you try the solution that is mentioned at the end of this issue: oracle/graalpython#378 ?
Run it before the pip install -r requirements.txt and pip should then use the already installed package.

Docker: there is a Dockerfile in the tools/Docker directory that might be a good start. Unfortunately, I haven't updated the image on docker hub, yet.

Update

I tried it on an old RP3 with Python 3.11.4 and it works:

  1. Install ACME by locally cloning the repo.
  2. Install tree-sitter-languages manually:
pip install wheel Cython
pip install --no-build-isolation git+https://github.com/grantjenks/py-tree-sitter-languages@v1.10.2
  1. Install the rest of the packages:
pip install -r requirements.txt
  1. Wait

I guess I have to update the Raspberry Pi HowTo.

@ankraft
Copy link
Owner

ankraft commented Sep 27, 2024

Could you please confirm that this solution solves your issue? Or did you find a better solution?

@Alan888-dev
Copy link
Author

Did not solve the problem. Now I am trying to compile Geos lib for version 3.8 but it is being an hard time (mainly because RPI zero is not very fast)... On laptop is everything well and the only difference for the RPI is the Geos version (laptop 3.8 and RPI 3.9)

@ankraft
Copy link
Owner

ankraft commented Sep 30, 2024

Ah, the geos library. At some point it was not available on RPis anymore. I remember now. And yes, everything takes forever on the zero. Make sure you do a backup of the SD card when you finished...

Would you be so kind to write down the steps that are required to compile and install it? I like to add this as an extra step to RPi HowTo as well.

@Alan888-dev
Copy link
Author

I am still trying... After compiling the GEOS 3.8.0 (the same I have in my laptop where ACME runs well) now I see the error: undefined symbol: GEOSDifferencePrec_r when: python -m acme

@Alan888-dev
Copy link
Author

After compiling geos 3.8.0:

$geos-config --version
returns: 3.8.0

$python -m acme

returns: undefined symbol: GEOSDifferencePrec_r...


Then:

$apt-get install libgeos-dev
$geos-config --version
returns 3.9.0

$python -m acme

Returns: undefined symbol: GEODensify_r

@ankraft
Copy link
Owner

ankraft commented Sep 30, 2024

I just checked the installation on my RPi3. Perhaps this helps?

Debian: 11.8 (via cat /etc/debian_version)
Python: 3.11.4 (via python3.11 --version)
shapely: 2.04 (via pip list)
geos: 3.9.0 (via geos-config --version)

@Alan888-dev
Copy link
Author

Alan888-dev commented Sep 30, 2024

I am trying now on a Raspberry Pi 2 B (to have a faster network / by cable). The difference to your RPI3 I think is the 32/64 bit (a part from RAM)
Even though, I am going to find out if it is possible to use the versions of your installation and see what happens...
By the way did you installed ACME using requirements.txt or just python -m pip install acmecse ?

@ankraft
Copy link
Owner

ankraft commented Sep 30, 2024

I have an old RPi zero W somewhere here. If I find time tomorrow I will try. I know that there are some limitations regarding dates and 32-bit timestamps I run into in the past, but I haven't tried to run ACME on that zero for some time.

Regarding installation method: Both. And both work fine. Maybe the Python 3.11 makes a difference?

Thank you very much for your patiences and perseverance!

@Alan888-dev
Copy link
Author

I would like to make some tests and ... to ACME in a low resource SBC so I started by trying the RPI Zero W. However I realized that some installing operations got failed because the network "time-out"/"read-error". Then I move to RPI 2B to use the network cable... However GEOS takes almost 12 hours to compile.
I also tried python 3.11 via apt get and via source code compilation (also more os less 12 hours to compile :-) and many other versions)... But I am still trying

@ankraft
Copy link
Owner

ankraft commented Oct 1, 2024

I will try in parallel.
I started the python 3.11.4 compile four hours ago on the RPi Zero W, and it's ongoing. I haven't even start with GEOS...

@Alan888-dev
Copy link
Author

Great! I have just compiled the 3.11.4. Geos is already installed in the right version... I am dealing now with shapely.

@Alan888-dev
Copy link
Author

RPI 1b:

Geos => 3.9.0 already

PYTHON 3.11.4:
wget (...)python 3.11.4
tar xf file.tar.xz
./configure
make
sudo make install
python3 --version
3.11.4

python3 -m pip install shapely==2.0.4
Uninstalled v2.0.6 and installed v2.0.4

python -m pip install acmecse
python -m pip install --upgrade acmecse
acmecse
Error:
undefined symbol: GEOSDensify_r

Then

git clone https://github.com/ankraft/ACME-oneM2M-CSE.git
cd ACME-oneM2M-CSE
python3 -m pip install -r requirements.txt
Error:
No matching distribution found for tree-sitter-languages==1.10.2

Then:
python3 -m pip install wheel Cython
python3 -m pip install --no-build-isolation git+https://github.com/grantjenks/py-tree-sitter-languages@v1.10.2
python3 -m acme
Error:
undefined symbol: GEOSDensify_r

Then:
python3 -m pip install -r requirements.txt
python3 -m acme
Error:
undefined symbol: GEOSDensify_r

acmecse
Error:
undefined symbol: GEOSDensify_r

No way...

@ankraft
Copy link
Owner

ankraft commented Oct 1, 2024

I am very sorry that after all these efforts the results are still the same. Perhaps there is a problem with the old 32 bit systems? But I have the GEOS lib running fine on my RPi3 test system.
I am still compiling on the old RPi zero and let you know. Whenever it is finished...

In case you just want to try and the newer features are not that important you may try to clone an older version of ACME? This one (https://github.com/ankraft/ACME-oneM2M-CSE/releases/tag/0.12.0) is the last one that doesn't use shapely etc for geo-location stuff.

In the meantime I installed the latest raspian version and now try that one. python 3.11 comes pre-installed, but will try to use a fresh install as well of Python 3.11.10.

@ankraft
Copy link
Owner

ankraft commented Oct 1, 2024

I got it working.

RPi Zero W with a fresh Raspian 12 "bookworm", lite version (w/o desktop). This version comes with Python 3.11.2 installed.

  • mkdir acme
  • cd acme
  • sudo apt install python3-pip
  • sudo apt-get install libopenblas-dev
  • python3 -m venv .
  • bin/pip install acmecse
  • For some reasons this pip manager chooses the wrong version of the "textual" version. Therefore: bin/pip install -U textual
  • bin/acmecse

Nothing else was necessary to install or compile.
ACME should run fine, except the text UI. There is a race condition that happens because the RPi Zero is too slow. I have to investigate how to handle this issue.

@Alan888-dev
Copy link
Author

Let me return to RPI Zero and try these actions... Thanks

@Alan888-dev
Copy link
Author

Everything goes well except:
bin/acmecse
which shows:
Error during import: Package 'textual.widgets' has no class 'TextArea'.

I have installed all requirements from requirements.txt with success but...

Can you share the package version for textual.widgets you are using, please?

@ankraft
Copy link
Owner

ankraft commented Oct 2, 2024

Did you execute bin/pip install -U textual
That should update the library to the version that contains that module. The latest one for textual is 0.81, I think.

There is another small problem with the bash shell's environment variables that is buggering this release (basically environment variables that contain a $ sign. I usually use the fish shell and never noticed this before. I will create a new release tomorrow.
Sorry for that.

@Alan888-dev
Copy link
Author

I re-executed all the steps again and now it is working.
I am using HTTP interface to remotely interact with ACME on the RPI zero and I have just created some AEs, executed some retrieve operations and it is working well.

Thank you so much!

@ankraft
Copy link
Owner

ankraft commented Oct 2, 2024

Great news!
Glad to be of help.

This also gave me some more details to add to the RPi how-to.

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

2 participants