praca w/w ?. Bo niby udało mi się zainstalować tą wersję na Bookworm python v2.7.18 co prawda niezalecanym sposobem tzn z innego repozytorium które na chwilę włączyłem dokładnie z Debiana Bullseye. Python v2 jest potrzebny do poprawnej pracy skryptu w pythonie poprawnie pracującego wyłącznie w tej wersji :-(
A jeszcze bardziej precyzując do poprawnej pracy z jego modułami np smbus nie z smbus2 !!! on raczej python3 . Udało mi się uruchomić środowisko wirtualne:
Kod: Zaznacz cały
sudo apt install virtualenv
trochę więcej info z terminala:
Kod: Zaznacz cały
(python2) root@orangepi3-lts:~# pip -V
pip 20.3.4 from /root/venv/python2/lib/python2.7/site-packages/pip (python 2.7)
python --version
Python 2.7.18
pip install smbuspip list
Package Version
---------- -------
pip 20.3.4
setuptools 44.1.1
wheel 0.37.1
Kod: Zaznacz cały
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting smbus
Using cached smbus-1.1.post2.tar.gz (104 kB)
Building wheels for collected packages: smbus
Building wheel for smbus (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /root/venv/python2/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-IK7XcT/smbus/setup.py'"'"'; __file__='"'"'/tmp/pip-install-IK7XcT/smbus/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-yiUojb
cwd: /tmp/pip-install-IK7XcT/smbus/
Complete output (14 lines):
running bdist_wheel
running build
running build_ext
building 'i2c' library
building 'smbus' extension
creating build
creating build/temp.linux-aarch64-2.7
aarch64-linux-gnu-gcc -pthread -fno-strict-aliasing -fPIC -fPIC -I/usr/include/python2.7 -c smbusmodule.c -o build/temp.linux-aarch64-2.7/smbusmodule.o -Iinclude
smbusmodule.c:20:10: fatal error: Python.h: Nie ma takiego pliku ani katalogu
20 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for smbus
Running setup.py clean for smbus
Failed to build smbus
Installing collected packages: smbus
Running setup.py install for smbus ... error
ERROR: Command errored out with exit status 1:
command: /root/venv/python2/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-IK7XcT/smbus/setup.py'"'"'; __file__='"'"'/tmp/pip-install-IK7XcT/smbus/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-UgYPhm/install-record.txt --single-version-externally-managed --compile --install-headers /root/venv/python2/include/site/python2.7/smbus
cwd: /tmp/pip-install-IK7XcT/smbus/
Complete output (14 lines):
running install
running build
running build_ext
building 'i2c' library
building 'smbus' extension
creating build
creating build/temp.linux-aarch64-2.7
aarch64-linux-gnu-gcc -pthread -fno-strict-aliasing -fPIC -fPIC -I/usr/include/python2.7 -c smbusmodule.c -o build/temp.linux-aarch64-2.7/smbusmodule.o -Iinclude
smbusmodule.c:20:10: fatal error: Python.h: Nie ma takiego pliku ani katalogu
20 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /root/venv/python2/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-IK7XcT/smbus/setup.py'"'"'; __file__='"'"'/tmp/pip-install-IK7XcT/smbus/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-UgYPhm/install-record.txt --single-version-externally-managed --compile --install-headers /root/venv/python2/include/site/python2.7/smbus Check the logs for full command output.
Jednak tak na 70% pomogło oczywiście jak wcześniej wspomniałem dodanie repozytorum bullseye do podstawowych bookworm-a instalacja python2 potem virtualenv i dodatkowo jeszcze :
Kod: Zaznacz cały
apt install python2.7-dev
Kod: Zaznacz cały
pip install smbus
bullseye i ...apt update
może komuś się przyda że jednak się da zainstalować pythona2 ( i module smbus ) na bookworm