Python Forum
Port my python program to Raspberry pi seamlessly - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Port my python program to Raspberry pi seamlessly (/thread-27959.html)



Port my python program to Raspberry pi seamlessly - Hassibayub - Jun-29-2020

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.


RE: Port my python program to Raspberry pi seamlessly - snippsat - Jun-29-2020

(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.