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

Support for python 3.9 and raspbian bullseye #36

Closed
matiasandina opened this issue Aug 19, 2022 · 6 comments
Closed

Support for python 3.9 and raspbian bullseye #36

matiasandina opened this issue Aug 19, 2022 · 6 comments

Comments

@matiasandina
Copy link
Owner

There were issues with installing the software in raspbian bullseye. After a simple import numpy:

(fedwatcher) pi@raspberrypi:~/FEDWatcher $ python3 fedwatcher/GUI.py 
Traceback (most recent call last):
  File "/home/pi/FEDWatcher/fedwatcher/GUI.py", line 5, in <module>
    import pandas as pd
  File "/home/pi/FEDWatcher/fedwatcher/lib/python3.9/site-packages/pandas/__init__.py", line 16, in <module>
    raise ImportError(
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.9 from "/home/pi/FEDWatcher/fedwatcher/bin/python3"
  * The NumPy version is: "1.21.6"

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

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

@matiasandina
Copy link
Owner Author

This first issue gets resolved with

sudo apt-get install libatlas-base-dev

Which is a dependency that needs to be installed for numpy to work.

@matiasandina
Copy link
Owner Author

matiasandina commented Aug 19, 2022

Second error is

(fedwatcher) pi@raspberrypi:~/FEDWatcher $ python3 fedwatcher/GUI.py 
Traceback (most recent call last):
  File "/home/pi/FEDWatcher/fedwatcher/GUI.py", line 5, in <module>
    import pandas as pd
  File "/home/pi/FEDWatcher/fedwatcher/lib/python3.9/site-packages/pandas/__init__.py", line 22, in <module>
    from pandas.compat import (
  File "/home/pi/FEDWatcher/fedwatcher/lib/python3.9/site-packages/pandas/compat/__init__.py", line 15, in <module>
    from pandas.compat.numpy import (
  File "/home/pi/FEDWatcher/fedwatcher/lib/python3.9/site-packages/pandas/compat/numpy/__init__.py", line 7, in <module>
    from pandas.util.version import Version
  File "/home/pi/FEDWatcher/fedwatcher/lib/python3.9/site-packages/pandas/util/__init__.py", line 1, in <module>
    from pandas.util._decorators import (  # noqa
  File "/home/pi/FEDWatcher/fedwatcher/lib/python3.9/site-packages/pandas/util/_decorators.py", line 14, in <module>
    from pandas._libs.properties import cache_readonly  # noqa
  File "/home/pi/FEDWatcher/fedwatcher/lib/python3.9/site-packages/pandas/_libs/__init__.py", line 13, in <module>
    from pandas._libs.interval import Interval
  File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 48 from C header, got 40 from PyObject

I cannot import pandas in the virtual environment either. Get the same error.

@matiasandina
Copy link
Owner Author

matiasandina commented Aug 19, 2022

After upgrading numpy via pip3 install -U numpy, error disappeared.

I'm not closing this until it can be replicated in a different environment.

image

@suttonak
Copy link

This solved the problem for me!!!

@matiasandina
Copy link
Owner Author

Issues continue:

There's probably an adjustment needed on f strings here.

Process Process-2:
Traceback (most recent call last):
  File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/pi/FEDWatcher/fedwatcher/src/fedwatcher.py", line 217, in runHelper
    self._save_all_df()
  File "/home/pi/FEDWatcher/fedwatcher/src/fedwatcher.py", line 403, in _save_all_df
    self._save_to_csv(df_data)
  File "/home/pi/FEDWatcher/fedwatcher/src/fedwatcher.py", line 368, in _save_to_csv
    filename = f"FED{df_data[0]['Device_Number']:03d}_{timestr}_{self.session_num:02d}.csv"
ValueError: Unknown format code 'd' for object of type 'str'

@matiasandina
Copy link
Owner Author

matiasandina commented Aug 22, 2022

explicit int conversion solved the problem

image

There is still some corruption of strings, but this was present before #29

@matiasandina matiasandina mentioned this issue Oct 3, 2022
14 tasks
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