fresh install of python-picamera on RPi4 errors out

Ask questions about Arch Linux ARM. Please search before making a new topic.

fresh install of python-picamera on RPi4 errors out

Postby hushpossum » Fri Jun 11, 2021 4:12 am

I'n new to ArchLinux, so apologies if this is covered elsewhere and I haven't found it. I am going to use my RPi for a camera-intensive application, but I have not been able to install python-picamera. A few details:

It's a new install on a Raspberry Pi 4 following the instructions for ARMv7 found here: https://archlinuxarm.org/platforms/armv ... berry-pi-4. I have installed raspberrypi-firmware. I am accessing the device headlessly via SSH, if it matters.

I found some suggestions, like these here: https://archlinuxarm.org/wiki/Raspberry_Pi. So, first problem -- if I include either 'start_file=start_x.elf' or 'fixup_file=fixup_x.dat' in boot/config.txt, then the pi doesn't boot. That seems bad.

Next, if I use either yaourt or (having upgraded) yay to install python-picamera, it gets almost all the way through and then errors out. Here's the most relevant feedback:
Code: Select all
==> Entering fakeroot environment...
==> Starting package()...
running install
Traceback (most recent call last):
  File "/home/alarm/.cache/yay/python-picamera/src/picamera-1.13/setup.py", line 145, in <module>
    main()
  File "/home/alarm/.cache/yay/python-picamera/src/picamera-1.13/setup.py", line 119, in main
    setup(
  File "/usr/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/alarm/.cache/yay/python-picamera/src/picamera-1.13/setup.py", line 109, in run
    raise ValueError('This system does not appear to be a Raspberry Pi')
ValueError: This system does not appear to be a Raspberry Pi
==> ERROR: A failure occurred in package().
    Aborting...
error making: python-picamera


Any suggestions, even on just where to look next?
hushpossum
 
Posts: 5
Joined: Fri Jun 11, 2021 2:48 am

Re: fresh install of python-picamera on RPi4 errors out

Postby graysky » Fri Jun 11, 2021 10:47 am

Not sure about the mods to boot.txt. Don't use AUR helpers. Just download from the AUR and build with makepkg. On aarch64, it worked for me. Is your system up-to-date prior to building?
graysky
 
Posts: 1007
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: fresh install of python-picamera on RPi4 errors out

Postby hushpossum » Fri Jun 11, 2021 2:50 pm

Thanks for your reply. My system is brand new and up to date with yaourt -Syu. I get the same error message if I install using makepkg.

Code: Select all
[alarm@alarmpi ~]$ git clone https://aur.archlinux.org/python-picamera.git
Cloning into 'python-picamera'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 23 (delta 0), reused 22 (delta 0), pack-reused 0
Unpacking objects: 100% (23/23), 5.79 KiB | 258.00 KiB/s, done.
[alarm@alarmpi ~]$ cd python-picamera
[alarm@alarmpi python-picamera]$ makepkg -si
==> Making package: python-picamera 1.13-3 (Fri Jun 11 14:45:40 2021)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading picamera-1.13.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  140k  100  140k    0     0   903k      0 --:--:-- --:--:-- --:--:--  903k
==> Validating source files with sha256sums...
    picamera-1.13.tar.gz ... Passed
==> Extracting sources...
  -> Extracting picamera-1.13.tar.gz with bsdtar
==> Starting build()...
running build
running build_py
creating build
creating build/lib
creating build/lib/picamera
copying picamera/display.py -> build/lib/picamera
copying picamera/color.py -> build/lib/picamera
copying picamera/mmalobj.py -> build/lib/picamera
copying picamera/array.py -> build/lib/picamera
copying picamera/bcm_host.py -> build/lib/picamera
copying picamera/mmal.py -> build/lib/picamera
copying picamera/__init__.py -> build/lib/picamera
copying picamera/frames.py -> build/lib/picamera
copying picamera/camera.py -> build/lib/picamera
copying picamera/encoders.py -> build/lib/picamera
copying picamera/renderers.py -> build/lib/picamera
copying picamera/streams.py -> build/lib/picamera
copying picamera/exc.py -> build/lib/picamera
running egg_info
writing picamera.egg-info/PKG-INFO
writing dependency_links to picamera.egg-info/dependency_links.txt
writing requirements to picamera.egg-info/requires.txt
writing top-level names to picamera.egg-info/top_level.txt
reading manifest file 'picamera.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'debian'
no previously-included directories found matching 'docs'
adding license file 'LICENSE.txt'
writing manifest file 'picamera.egg-info/SOURCES.txt'
==> Entering fakeroot environment...
==> Starting package()...
running install
Traceback (most recent call last):
  File "/home/alarm/python-picamera/src/picamera-1.13/setup.py", line 145, in <module>
    main()
  File "/home/alarm/python-picamera/src/picamera-1.13/setup.py", line 119, in main
    setup(
  File "/usr/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/alarm/python-picamera/src/picamera-1.13/setup.py", line 109, in run
    raise ValueError('This system does not appear to be a Raspberry Pi')
ValueError: This system does not appear to be a Raspberry Pi
==> ERROR: A failure occurred in package().
    Aborting...
hushpossum
 
Posts: 5
Joined: Fri Jun 11, 2021 2:48 am

Re: fresh install of python-picamera on RPi4 errors out

Postby graysky » Fri Jun 11, 2021 6:09 pm

I see. It does not build on armv7h. I do not know why. If you switch over to aarch64 it builds fine. You might want to ping the package maintainer or upstream after you google it.
graysky
 
Posts: 1007
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: fresh install of python-picamera on RPi4 errors out

Postby hushpossum » Sun Jun 13, 2021 10:57 pm

Thanks, graysky, but I'm still banging my head against this. I tried a fresh aarch64 install and ran into the exact same error. I feel like I must be missing something obvious, because trying to do the most vanilla install possible still ends me up in the same place. Here is EXACTLY how I produce this error, starting with a fresh 32GB sd card:

Code: Select all
#fdisk /dev/sda
  o, p # there are no partitions, as expected
  n, p, 1, enter, +120M, t, c # Partition 1 is now 'W95 FAT32 (LBA)'
  n, p, 2, enter, enter
  w
#mkfs.vfat /dev/sda1
#mkdir boot
#mount /dev/sda1 boot
#mkfs.ext4 /dev/sda2
#mkdir root
#mount /dev/sda2 root
#wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz
#bsdtar -xpf ArchLinuxARM-rpi-aarch64-latest.tar.gz -C root
#sync
#mv root/boot/* boot
#sed -i 's/mmcblk0/mmcblk1/g' root/etc/fstab
#umount boot root

#ssh alarm@[local ip]
The authenticity of host ... can't be established.  ECDSA key fingerprint is ...
Are you sure you want to continue connecting? yes
alarm password [alarm]
$su root
root password [root]
#pacman-key --init
#pacman-key --populate archlinuxarm
#pacman -Syyu
Proceed with installation? y
#pacman -S sudo git base-devel wget
Enter a selection (default=all): [enter]
Proceed with installation? y
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
gpasswd -a alarm wheel
#reboot

#ssh alarm@[local ip]
alarm password [alarm]
$mkdir -p /tmp/package-query && cd /tmp/package-query
$wget https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=package-query -O PKGBUILD
$makepkg -si
Proceed with installation? y
$cd
$git clone https://aur.archlinux.org/python-picamera.git
$cd python-picamera
$makepkg -si
Proceed with installation? y


This results in the exact same error I've been seeing all week.
ValueError: Unable to determine if this system is a Raspberry Pi
hushpossum
 
Posts: 5
Joined: Fri Jun 11, 2021 2:48 am

Re: fresh install of python-picamera on RPi4 errors out

Postby graysky » Sun Jun 13, 2021 11:25 pm

Builds fine me for me???

You can download the package I built from here until you figure out what's wrong with your setup: http://repo-ck.com/aarch64-test/
graysky
 
Posts: 1007
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: fresh install of python-picamera on RPi4 errors out

Postby hushpossum » Mon Jun 14, 2021 1:37 am

I'll give it a try!
hushpossum
 
Posts: 5
Joined: Fri Jun 11, 2021 2:48 am

Re: fresh install of python-picamera on RPi4 errors out

Postby hushpossum » Tue Jun 15, 2021 5:08 am

Well, the plot thickens! Your (graysky's) version of python-picamera installed without any hiccups, but when I try to use it I get a new error:

Code: Select all
#cam_test.py
from picamera import PiCamera
camera = PiCamera()
camera.capture('test.jpg')
------------------------------
$ python cam_test.py
OSError: libmmal.so: cannot open shared object file: No such file or directory


I also don't have /opt/vc/bin/raspistill or /opt/vc/bin/raspbivid, which according to the wiki should have come with raspberrypi-firmware. Pacman insists that the firmware is up to date, and indeed reinstalling doesn't change anything.
hushpossum
 
Posts: 5
Joined: Fri Jun 11, 2021 2:48 am

Re: fresh install of python-picamera on RPi4 errors out

Postby graysky » Tue Jun 15, 2021 10:38 am

EDIT: They are not yet supported on 64-bit images, see: https://github.com/raspberrypi/userland/issues/688

If you really want/need this, you'll have to switch to armv7h until upstream fixes and adds them. There potential for you to see the ubuntu code referenced and add the reverted patches back and build your own version of raspberrypi-firmware that provides this support under aarch64.
graysky
 
Posts: 1007
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: fresh install of python-picamera on RPi4 errors out

Postby unformatted » Tue Jun 15, 2021 11:08 am

I'm on a RPi3 using armv7l.

This morning before I updated my system I checked my python camera scripts (using python-picamera) and all was working. After updating I run my python scipts again and it throwed an error "ModuleNotFoundError: No module named 'picamera'".

Strange, since the AUR package has not been changed since 2019-10-21 21:04. My last system update was in february this year.

I reinstalled python-picamera from AUR and now it is working fine.
unformatted
 
Posts: 32
Joined: Tue Mar 09, 2021 5:23 pm

Next

Return to User Questions

Who is online

Users browsing this forum: No registered users and 3 guests