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

Install on Raspberry OS lite is missing dependency for Numpy #9

Open
MikonosII opened this issue Feb 2, 2021 · 10 comments
Open

Install on Raspberry OS lite is missing dependency for Numpy #9

MikonosII opened this issue Feb 2, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@MikonosII
Copy link

MikonosII commented Feb 2, 2021

Got this error:

Traceback (most recent call last):
File "/usr/local/bin/cbpi", line 6, in
from cbpi.cli import main
File "/usr/local/lib/python3.7/dist-packages/cbpi/cli.py", line 11, in
from cbpi.craftbeerpi import CraftBeerPi
File "/usr/local/lib/python3.7/dist-packages/cbpi/craftbeerpi.py", line 25, in
from cbpi.controller.log_file_controller import LogController
File "/usr/local/lib/python3.7/dist-packages/cbpi/controller/log_file_controller.py", line 7, in
import pandas as pd
File "/usr/local/lib/python3.7/dist-packages/pandas/init.py", line 17, in
"Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
ImportError: Unable to import required dependencies:
numpy:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:

  • The Python version is: Python3.7 from "/usr/bin/python3"
  • The NumPy version is: "1.20.0"
    and make sure that they are the versions you expect.
    Please carefully study the documentation linked above for further help.
    Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory

Fix was to install the missing dependency: libatlas-base-dev

or to reinstall Numpy using:

pip3 uninstall numpy # remove previously installed version
apt install python3-numpy

@Manuel83
Copy link
Collaborator

Manuel83 commented Feb 2, 2021

Can you let me know how did you install cbpi
Which version of CBPI are you running?

Run the follwing command to print all installed python components:

pip list

@Manuel83 Manuel83 added the bug Something isn't working label Feb 2, 2021
@MikonosII
Copy link
Author

MikonosII commented Feb 2, 2021

CBPI V4.0
Steps to install and run CBPI V4

  1. installed the latest raspberry pi os lite from https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-01-12/2021-01-11-raspios-buster-armhf-lite.zip
  2. sudo apt-get install python3-pip
  3. sudo python3 -m pip install cbpi
  4. cbpi setup
  5. I got the above error
  6. sudo apt-get install libatlas-base-dev
  7. cbpi setup
  8. runs as advertised

`pi@cbpi:~ $ pip3 list
Package Version


aiohttp 3.7.3
aiohttp-auth 0.1.1
aiohttp-route-decorator 0.1.4
aiohttp-security 0.4.0
aiohttp-session 2.9.0
aiohttp-swagger 1.0.15
aiojobs 0.3.0
aiosqlite 0.16.0
asn1crypto 0.24.0
async-timeout 3.0.1
attrs 20.3.0
cbpi 4.0.0.13
cbpi4-ui 0.0.3
certifi 2018.8.24
cffi 1.14.4
chardet 3.0.4
click 7.1.2
cryptography 3.3.1
entrypoints 0.3
idna 2.6
Jinja2 2.11.3
keyring 17.1.1
keyrings.alt 3.1.1
MarkupSafe 1.1.1
multidict 5.1.0
numpy 1.20.0
pandas 1.1.5
pip 18.1
pycparser 2.20
pycrypto 2.6.1
pyfiglet 0.8.post1
PyGObject 3.30.4
python-apt 1.8.4.3
python-dateutil 2.8.1
pytz 2021.1
pyxdg 0.25
PyYAML 5.4.1
requests 2.25.1
SecretStorage 2.3.1
setuptools 40.8.0
shortuuid 1.0.1
six 1.12.0
ssh-import-id 5.7
tabulate 0.8.7
ticket-auth 0.1.4
typing-extensions 3.7.4.3
urllib3 1.24.1
voluptuous 0.12.1
wheel 0.32.3
yarl 1.6.3 '

@mmiller1br
Copy link

same error for me when I tried to upgrade from version 4.0.0.12 to 4.0.0.13 using "sudo python3 -m pip install cbpi --force-reinstall". After install dependencies, WebGUI can not load, returning error:
{"error": "Not Found"}

@Manuel83
Copy link
Collaborator

Manuel83 commented Feb 3, 2021

Are using a virtual environment?
Can you try a virtual environment? See documentation how to setup this

https://app.gitbook.com/@craftbeerpi/s/craftbeerpi4/

Can you post the complete error message.

which command raised this error?

@avollkopf
Copy link
Contributor

avollkopf commented Feb 3, 2021

Same her when I do it in a virtual environment on my pi. It's running on my ubuntu container w/o issues. I installed the version from GIThub.

Basically the same message as above.

(venv) pi@raspberrypi:~/cbpi4 $ sudo cbpi setup
Traceback (most recent call last):
  File "/usr/local/bin/cbpi", line 6, in <module>
    from cbpi.cli import main
  File "/usr/local/lib/python3.7/dist-packages/cbpi/cli.py", line 11, in <module>
    from cbpi.craftbeerpi import CraftBeerPi
  File "/usr/local/lib/python3.7/dist-packages/cbpi/craftbeerpi.py", line 25, in <module>
    from cbpi.controller.log_file_controller import LogController
  File "/usr/local/lib/python3.7/dist-packages/cbpi/controller/log_file_controller.py", line 7, in <module>
    import pandas as pd
  File "/usr/local/lib/python3.7/dist-packages/pandas/__init__.py", line 17, in <module>
    "Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
ImportError: Unable to import required dependencies:
numpy:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.7 from "/usr/bin/python3"
  * The NumPy version is: "1.20.0"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory

A re-install via pip3 does not help, but as already describe above:
sudo apt install python3-numpy

is solving the issue with the setup.

But starting it causes other issues. I will do that better on a separate sd-card on my pi an dnot in aprallel to cbpi3 :-)

@avollkopf
Copy link
Contributor

I retried it this morning and it seems to me that this is related to rights. I can set up a venv and run the installation within the venv (w/o sudo).

Everything seems to install, but some packages cannot be build. if you re-run this later with sudo, the missing packages can be build.

Setup is working but then I get the numpy error. I can uninstall numpy via pip, but can't install python3-numpy from the virtual environment w/o sudo. If I install it with sudo I get the information that it is already installed. But If I try to start cbpi from the venv I get the error message that numpy is missing.

If I install it w/o venv, it seem to work. I could also add my plugin for the pt100/pt1000. No error messages, but it does not load. Anyway, I will dig into this with a separate SD card as I am currently running a fermentation and I do not want to screw up the existing cbpi3 installation.

@lalo-uy
Copy link

lalo-uy commented Feb 4, 2021

I have the same problem.
Fresh install Raspbian Buster.
Updated and upgraded
The missing dependency is corrected by:

sudo apt-get install libatlas-base-dev

@mmillerbr
Copy link

Mine is solved. I had to uninstall and remove all files in the folder I've used to install cbpi.
After that, I did the installation again using "pip3"and it's working now.
Super cool !

@avollkopf
Copy link
Contributor

If I install it from github, folders and databse are not created via cbpi setup (4.0.0.14)

However, everything is installing fine via pip3 install cbpi as package (V4.0.0.13). The setup process is installing the folders and the database and I can start cbpi.

When I now remove cbpi and the cbpi4-ui package, I can install the github version where the setup process is using the existing foldaers and database. Afterwards cbpi 4.0.0.14 can be started.

Not sure if this is related to the latest update were some folder setting where modified.

It is now running on my pi. However, so far I did not manage it to run in a virtual environment on my pi

I did not notice this behavior on earlier versions on my ubuntu containers running on my NAS. Here I could also install cbpi in venv.

@staticdev
Copy link

staticdev commented May 8, 2021

I created an initial PR #74 to avoid this kind of problems. It does not completely solves the problem (since numpy is not a direct dependency for this project - for that we needed pinned dependency tree which is also possible with tools like poetry - good article on that here), but is a step towards better dependency management here.

Manuel83 pushed a commit that referenced this issue Feb 25, 2022
Improve CI build and fix docker build issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants