Python code for Rasberry PI
Hello,
I am a Python programmer. I have never used a Raspberry PI
I developed Python code for UAVs that uses TensorFlow, numpy, neural networks, and pandas libraries.
1. How do I upload Python code?
2. Is there a special way to upload Python libraries separately from the operational code? Libraries do not have to be re-uploaded unless the kernel dies.
3. Are there any limitations concerning software: size, etc?
I used this code successfully on a Mac with an M1 chip. There are some differences between M1 and Windows environments in running certain pieces of TensorFlow. Any suggestions and warnings will be highly appreciated.
Thank you!
I am a Python programmer. I have never used a Raspberry PI
I developed Python code for UAVs that uses TensorFlow, numpy, neural networks, and pandas libraries.
1. How do I upload Python code?
2. Is there a special way to upload Python libraries separately from the operational code? Libraries do not have to be re-uploaded unless the kernel dies.
3. Are there any limitations concerning software: size, etc?
I used this code successfully on a Mac with an M1 chip. There are some differences between M1 and Windows environments in running certain pieces of TensorFlow. Any suggestions and warnings will be highly appreciated.
Thank you!
Re: Python code for Rasberry PI
Welcome to the forum.
Python on Raspberry PI enforces Virtual Environments which will contain all of our project code isolated from other projects and system code.
Python on Raspberry PI enforces Virtual Environments which will contain all of our project code isolated from other projects and system code.
Re: Python code for Rasberry PI
Only if you don't want to use the system version of Python.
Oh no, not again.
Re: Python code for Rasberry PI
Nothing special about the Pi. It's basically a Linux box.bigbear11 wrote: ↑Mon Apr 28, 2025 10:11 pmHello,
I am a Python programmer. I have never used a Raspberry PI
I developed Python code for UAVs that uses TensorFlow, numpy, neural networks, and pandas libraries.
1. How do I upload Python code?
2. Is there a special way to upload Python libraries separately from the operational code? Libraries do not have to be re-uploaded unless the kernel dies.
3. Are there any limitations concerning software: size, etc?
I used this code successfully on a Mac with an M1 chip. There are some differences between M1 and Windows environments in running certain pieces of TensorFlow. Any suggestions and warnings will be highly appreciated.
Thank you!
Oh no, not again.
Re: Python code for Rasberry PI
Which is a very good way to bring in library dependencies such as panda, tensorflow, etc. Use a requirements.txt file in your project source and use that to create a venv with the correct libraries.
As for a special way to get the code on to the Pi, nope, choose your method. For something like this you may consider hosting your code on Github and cloning the project on to your Pi from there.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter
Pi Interests: Home Automation, IOT, Python and Tkinter
Re: Python code for Rasberry PI
If you target primary RPi as target, then use the installed Python version of the OS.
If you want a newer Python version, use pyenv.
Install the required libraries, build-essental and git.
https://github.com/pyenv/pyenv/wiki#sug ... nvironment
Then install pyenv:
https://github.com/pyenv/pyenv-installe ... le#install
Do the required steps to add the pyenv command to .bashrc or .profile.
After this stpes, you can build with the help of pyenv as a normal user a newer python version and use it as a user. Do not use it system-wide, because it will break some tool which depends on the Python version delivered by Raspberry Pi OS.
If you use e.G. `pyenv shell 3.13.3` it activates in your current terminal session Python 3.13.3.
If you install packages via pip a virtual environment is not required, but recommended.
Some packages requires additional libraries and some of them requires very long to compile on a Raspberry Pi like `lxml`.
If you want a newer Python version, use pyenv.
Install the required libraries, build-essental and git.
https://github.com/pyenv/pyenv/wiki#sug ... nvironment
Code: Select all
sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl git \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
https://github.com/pyenv/pyenv-installe ... le#install
Do the required steps to add the pyenv command to .bashrc or .profile.
After this stpes, you can build with the help of pyenv as a normal user a newer python version and use it as a user. Do not use it system-wide, because it will break some tool which depends on the Python version delivered by Raspberry Pi OS.
If you use e.G. `pyenv shell 3.13.3` it activates in your current terminal session Python 3.13.3.
If you install packages via pip a virtual environment is not required, but recommended.
Some packages requires additional libraries and some of them requires very long to compile on a Raspberry Pi like `lxml`.
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion