Python Forum
Port my python program to Raspberry pi seamlessly
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Port my python program to Raspberry pi seamlessly
#1
I'm working on the IRIS recognition system and it is almost complete now.
Now the pain is to port this program from my laptop (working in conda environment) to raspberry pi 3b+.

I know raspberry pi does not support every package and it is hard to install some of the packages, tons of errors and dependencies compatibility issues (ie: Opencv is a pain for a naive Linux user)

I'm looking for a seamless solution to port my program with minimalistic setup somehow (incl. OpenCV)

I've seen docker and spent 2 days on it and didn't get it how it's useful for my case.
Reply
#2
(Jun-29-2020, 09:14 AM)Hassibayub Wrote: Now the pain is to port this program from my laptop (working in conda environment) to raspberry pi 3b+.
Could output to a requirements.txt instead of .yml,if not conda not installed on raspberry pi.
# Export
conda list --export > requirements.txt

# Install with pip
pip install -r requirements.txt

# If have conda
conda install --yes --file  requirements.txt
(Jun-29-2020, 09:14 AM)Hassibayub Wrote: tons of errors and dependencies compatibility issues (ie: Opencv is a pain for a naive Linux user)
If have a newer Python 3 version is should work fine without to much difficulty with opencv-python.
pip install opencv-python
Quick test on Mint 19,see that if find right wheel as i use python 3.8
List of wheels for opencv-python
tom@tom:~$ python -V
Python 3.8.3

tom@tom:~$ pip install opencv-python
Collecting opencv-python
  Downloading https://files.pythonhosted.org/packages/0b/61/84..../opencv_python-4.2.0.34-cp38-cp38-manylinux1_x86_64.whl (28.2MB)
     
Successfully installed numpy-1.19.0 opencv-python-4.2.0.34

# Test that it work 
tom@tom:~$ python
Python 3.8.3 (default, May 23 2020, 23:37:36) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> 
>>> cv2.__version__
'4.2.0'
>>> exit()
tom@tom:~$ 
Try to make it simple if this is a personal project you want to port,eg test that opencv-python work on raspberry pi.
If want to make available for more users then look into setup.py(this make a wheel).
Then PyPi can be used as a central distribution of that wheel.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  MCU reboots after opening Serial port when ran from Raspberry PI zazas321 3 330 Mar-19-2024, 09:02 AM
Last Post: zazas321
  Python error on mentioned Arduino port name dghosal 5 797 Aug-22-2023, 04:54 PM
Last Post: deanhystad
  Video recording with Raspberry Pi - What´s wrong with my python code? Montezuma1502 3 1,180 Feb-24-2023, 06:14 PM
Last Post: deanhystad
  python serial port barryjo 2 1,601 Dec-27-2021, 11:09 PM
Last Post: barryjo
  Coding for Python and Raspberry pi beast 3 39,377 Sep-21-2021, 09:56 PM
Last Post: beast
  is there a way to mention port range or search for port dynamically with qConnection Creepy 0 1,449 Sep-09-2021, 03:15 PM
Last Post: Creepy
  python 3 raspberry pi 4 dual control motor programming problem yome 0 1,938 Mar-21-2021, 05:17 PM
Last Post: yome
  Embedded python fails to compile on Raspberry Pi tryfon 2 3,398 Dec-22-2020, 02:06 PM
Last Post: tryfon
  Uploading files to NAS from Raspberry PI using python zazas321 0 2,424 Sep-07-2020, 09:02 AM
Last Post: zazas321
  please help me in loop i am trying to run this program in raspberry pi by sending msg saifullahbhutta 2 2,297 Jan-27-2020, 02:32 PM
Last Post: saifullahbhutta

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020