This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No module named pypilot
#11
(2026-05-10, 05:11 AM)seandepagnier Wrote: Sorry for all the trouble.  Some contributions updated the packaging of pypilot to use pip instead of the older setuptools.

There is an openplotter-pypilot package which makes a simple gui installer for pypilot and to enable/disable services.  It is technically optional.

Despite this I have updated it to hopefully work.  Really, it must be fixed to pull a tagged branch to avoid this breakage, and that is my fault, I will do this in the future.

For now you can try this:
Code:
git clone https://github.com/pypilot/openplotter-pypilot
cd openplotter-pypilot/openplotterPypilot
sudo python pypilotPostInstall.py


This should install everything and you can enable pypilot either with "sudo systemctl start pypilot"  or via the gui:

Code:
python openplotterPypilot.py

If this should fail you can try without the openplotter-pypilot helper scripts (should work on any linux system) eg:
Code:
git clone https://github.com/pypilot/pypilot --depth 1
cd pypilot
sudo python3 -m pip install .[optimize,ui,hat,web] --break-system-packages
sudo cp -rv scripts/debian/etc/systemd /etc
sudo systemctl daemon-reload
git clone --depth 1 https://github.com/pypilot/pypilot_data
cd pypilot_data
python3 -m pip install . --break-system-packages


Of course in the rpi config you must enable i2c (for the imu)  spi (if using pypilot hat) and enable the hardware serial port..  in the openplotter serial config click the UART0 button or edit /boot/firmware/config.txt and ensure the line "dtoverlay=disable-bt"

Please let me know if this doesn't work and/or ideas to make this all easier because I don't really like the manual steps and complications.  I am thinking mostly the openplotter-pypilot must be pinned to a tag of pypilot, and it should probably do a better just of enabling i2c spi and the uart all automatically or with very few clicks.

Hi seandepagnier

I got to this point      python openplotterPypilot.py
Pypilot 3.2.9 started instead of Pypilot 4.0.11 but I was still not able to get the "Enable IMU Only" to stay. It went right back to disabled. 

This is what was happening in Terminal every time I tried to turn on the Enable IMU Only
Any ideas on whats going on?

pi@DeltaVeePi:~/openplotter-pypilot/openplotterPypilot $ python openplotterPypilot.py
activating
inactive
activating
inactive
inactive
inactive
activating
Created symlink /etc/systemd/system/local-fs.target.wants/pypilot_boatimu.service -> /etc/systemd/system/pypilot_boatimu.service.
Failed to enable unit: Unit file openplotter-pypilot-read.service does not exist.
Failed to restart openplotter-pypilot-read.service: Unit openplotter-pypilot-read.service not found.
inactive
activating
inactive
inactive
inactive
Failed to disable unit: Unit file openplotter-pypilot-read.service does not exist.
Failed to stop openplotter-pypilot-read.service: Unit openplotter-pypilot-read.service not loaded.
Removed "/etc/systemd/system/local-fs.target.wants/pypilot_boatimu.service".
Created symlink /etc/systemd/system/local-fs.target.wants/pypilot.service -> /etc/systemd/system/pypilot.service.
activating
inactive
inactive
inactive
activating
Removed "/etc/systemd/system/local-fs.target.wants/pypilot.service".
Created symlink /etc/systemd/system/local-fs.target.wants/pypilot_boatimu.service -> /etc/systemd/system/pypilot_boatimu.service.
Failed to enable unit: Unit file openplotter-pypilot-read.service does not exist.
Failed to restart openplotter-pypilot-read.service: Unit openplotter-pypilot-read.service not found.
inactive
activating
inactive
inactive
inactive
Failed to enable unit: Unit file openplotter-pypilot-read.service does not exist.
Failed to restart openplotter-pypilot-read.service: Unit openplotter-pypilot-read.service not found.
inactive
activating
inactive
inactive
inactive
Failed to enable unit: Unit file openplotter-pypilot-read.service does not exist.
Failed to restart openplotter-pypilot-read.service: Unit openplotter-pypilot-read.service not found.
inactive
activating
inactive
inactive
inactive
Reply
#12
(2026-05-12, 03:05 AM)Tom60 You are lucking your install  pypilot was succesfull. It is a python script and is conflict the system manager (sudo apt). See:https://www.technetexperts.com/fix-pip-externally-managed-environment-error/Maybe i will succeed with these instructions. Otherway i will try nautinect. Arduino-ide is easier for a non icter. Wrote:
(2026-05-11, 12:09 PM)ReinierD Wrote: Didn't work for me. Still no working pypilot. By menu openplotter-pypilot nor in the terminal. Just the hourglass for a few minutes and nothing starts.
The last option ' works for any linux os' I did for this conversation in the op4. So a fresh start on nvme ssd to usb with op4 d.d. 24-06-19  all working accept pypilot. The in the terminal as Sean suggested. Still no working pypilot. 
The time I compiled linux kernel are long gone thanks to ubuntu and distro mint. So I think I will not succeed in revolving pip conflicting with the system packing manager. So I am depending on a solution of experts.
 I have a backup of 2022 working on rp4b, I will try if it works on the rp5 otherway I have to wait.

Reinier,
I am a novice with linux and just followed the OP4 installation instructions here.   I have a RPi5 with nvme base.   I have lost count of the number of times I have done a fresh install of OP4 attempting to get Pypilot working.  However I now have Pypilot working (apart from the missing spheres in Calibration.
When you go to Openplotter - Settings is Pypilot shown as installed?  If it is; can you load it and confirm the imu is recognised?  If you cannot load Pypilot can you go to Openplotter - i2C - i2C Addresses and confirm 68 is shown (this is the imu address).  
Tom
Reply
#13
Same problem with pypilot, Raspberry Pi 5 + Mac Arthur HAT + IMU 20948 + SSD.
None of the suggested solutions have worked for me.
Is there any prospect of finding a solution?
Reply
#14
Reinier
These are my exact steps
1. A full format of a 16GB USB stick
2. Use the Raspberry Imager to install OP4 on the stick
3. Change the Rpi boot order to boot from the USB stick
4. Boot into OP4 from the USB stick
5. Activate SSH, VNC, i2C
6. Follow the OP4 instructions (https://openplotter.readthedocs.io/lates...s_app.html) to install required modules, including Pypilot. Configure all the required settings in the Serial module.
7. Pypilot loads showing the IMU but also shows there is no module named pypilot. Close pypilot.
8. Start a Terminal and enter git clone --depth 1 https://github.com/pypilot/pypilot
9. Then cd /pypilot
10. Next sudo python3 setup.py install This installs Pypilot
11. Open pypilot and you should see Pypilot version 0.70
12. If you don’t see the version Reboot the Pi and check again
13. At this point I could see the version but there was an issue with the Calibration. No Yacht or Sphere images. I needed to remake the connection for the Arduino in Pypilot
14. I followed Sean’s instructions (Post 7#) above. This additionally got me the missing Yacht image, but not the Spheres.
This is where I currently am. The Rpi is sending commands to my Arduino and the linear actuator moves. However I cannot complete the Autopilot calibration.
When I have the Calibration issue resolved I will copy the USB Stick to the NVME ssd.
Tom
Reply
#15
I tried the update Sean posted and could not get the Pypilot app to recognize the motor controller which was not an issue before. I also had the issue of the calibration pages not showing the sphere. So I wiped my as card and installed the starting image and tried everything again and now the Pypilot app won’t even open. I feel the issue is with the new 4.0.11 beta update as Pypilot worked perfectly before that update came out and being I am starting fresh now it will only pull that update. Is there a way to get an older version?
Reply
#16
for the motor controller, one simple test is:

ls -l /dev/serial0

It must point to /dev/ttyAMA0 So maybe in openplotter-serial you did not enable uart0 ?

for calibration not showing, are there any other messages? Did you enable i2c?

Can you possibly stop the service:
sudo systemctl stop pypilot

Now just run pypilot in a terminal
```
pypilot
```

and if you can post the output. Also similarly for the pypilot_web service.

There are actually quite a few changes and fixes recently integrated so be sure to pull from github if you can. I am hoping to stabilize this soon.

I think the issue with calibration is that I removed the scipy dependency switching to odrpack but this cannot install always on the pi? Does "pip install odrpack --break-system-packages" succeed? Anyway, I am working on a fall-back to support scipy as well.
Reply
#17
Sean,

The following are the results from my system per your request at Post #16 above

pi@openplotter:~ $ ls -l /dev/serial0
lrwxrwxrwx 1 root root 8 May 16 06:11 /dev/serial0 -> ttyAMA10

pi@openplotter:~ $ sudo systemctl stop pypilot

pi@openplotter:~ $ pypilot
autopilot start 10644.236221326
loading translations: terminal encoding: utf-8
pilot append <class 'pilots.basic.BasicPilot'>
pilot append <class 'pilots.wind.WindPilot'>
pilot append <class 'pilots.absolute.AbsolutePilot'>
world magnetic model not available
imu process 27508
made imu process realtime
Using settings file RTIMULib.ini
Settings file not found. Using defaults and creating settings file
Detected ICM20948 at standard address
Using fusion algorithm Kalman STATE4
IMU Name: ICM-20948
min/max compass calibration not in use
Using ellipsoid compass calibration
Using accel calibration
nmea process 27521
listening on port 20220 for nmea connections
signalk process 27523
gps process 27524
loading servo calibration /home/pi/.pypilot/servocalibration
WARNING: using default servo calibration!!
Available Pilots: ['basic', 'wind', 'absolute']
server process start 10644.442444261
pypilotServer process 27526
server init 10644.445819803
load file /home/pi/.pypilot/pypilot.conf
store_file /home/pi/.pypilot/pypilot.conf.bak 10644.457 False
pypilotinit complete 10644.458616377
ICM-20948 init complete
serialprobe removing gps device /dev/serial/by-id/usb-u-blox_AG_-_www.u-blox.com_u-blox_7_-_GPS_GNSS_Receiver-if00
servo probe ('/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A5069RR4-if00-port0', 38400) 10644.509978035
server listening 10644.518337365
server setup has 6 pipes
zeroconf addresses [('eth0', '192.168.1.108')] 1
zeroconf[eth0] = Zeroconf(ip_version=IPVersion.V4Only, interfaces=[192.168.1.108])
gps filter process 27525
imu rate set to rate 20
IMU all sensor axes verified
setting initial gyro bias [0.74, 0.9, -0.72]
arduino servo found ['/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A5069RR4-if00-port0', 38400]
serialprobe success: /home/pi/.pypilot/servodevice ['/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A5069RR4-if00-port0', 38400]
Arduino motor controller EEPROM SIGNATURE ok
gpsd connected
GPSD devices []
failed import calibration fit No module named 'minpack'
signalk zeroconf service add openplotter._http._tcp.local. _http._tcp.local.
signalk read token
signalk zeroconf service add HP DeskJet 2800 series [0832BD]._http._tcp.local. _http._tcp.local.
signalk server found 192.168.1.108:3000
signalk found ws://192.168.1.108:3000/signalk/v1/stream?subscribe=none
signalk connected to ws://192.168.1.108:3000/signalk/v1/stream?subscribe=none
failed import calibration fit No module named 'minpack'
failed import calibration fit No module named 'minpack'
failed import calibration fit No module named 'minpack'
failed import calibration fit No module named 'minpack'
failed import calibration fit No module named 'minpack'

[line was just repeating at this point so I stopped it with Ctrl-C

^Cgot signal 2 cleaning up
Process GPSFilterProcess-7:
kill 27526 <Process name='server' pid=27526 parent=27504 started daemon>
kill 27523 <Process name='signalk' pid=27523 parent=27504 started daemon>
kill 27525 <GPSFilterProcess name='GPSFilterProcess-7' pid=27525 parent=27504 started daemon>
kill 27524 <gpsProcess name='gpsd' pid=27524 parent=27504 started daemon>
kill 27521 <Process name='nmea' pid=27521 parent=27504 started daemon>
kill 27506 <Process name='calibration' pid=27506 parent=27504 started daemon>
kill 27508 <Process name='imu' pid=27508 parent=27504 started daemon>
Traceback (most recent call last):
File "/usr/local/bin/pypilot", line 33, in <module>
sys.exit(load_entry_point('pypilot==0.70', 'console_scripts', 'pypilot')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pypilot/autopilot.py", line 526, in main
ap.iteration()
File "/usr/local/lib/python3.11/dist-packages/pypilot/autopilot.py", line 354, in iteration
msgs = self.client.receive(rdt)
got signal 17 cleaning up
object address : 0x7ffeecc46560
object refcount : 2
object type : 0xa15120
object type name: KeyboardInterrupt
object repr : KeyboardInterrupt()
lost sys.stderr
got signal atexit cleaning up

pi@openplotter:~ $

pi@openplotter:~ $ pypilot_web service
loading translations: terminal encoding: utf-8
loading translations: terminal encoding: utf-8
failed to read config /home/pi/.pypilot/web.conf
Traceback (most recent call last):
File "/usr/local/bin/pypilot_web", line 33, in <module>
sys.exit(load_entry_point('pypilot==0.70', 'console_scripts', 'pypilot_web')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/pypilot_web", line 25, in importlib_load_entry_point
return next(matches).load()
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
module = import_module(match.group('module'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/local/lib/python3.11/dist-packages/pypilot/web/web.py", line 46, in <module>
pypilot_web_port=int(sys.argv[1])
^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'service'
pi@openplotter:~ $

pi@openplotter:~ $ pip install odrpack --break-system-packages
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting odrpack
Downloading odrpack-0.5.0.tar.gz (107 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 107.3/107.3 kB 1.0 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [41 lines of output]
+ meson setup /tmp/pip-install-iv5l8kg7/odrpack_bcceb2a076bd442db31fb02adb14ecf0 /tmp/pip-install-iv5l8kg7/odrpack_bcceb2a076bd442db31fb02adb14ecf0/.mesonpy-_f61c11h -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-iv5l8kg7/odrpack_bcceb2a076bd442db31fb02adb14ecf0/.mesonpy-_f61c11h/meson-python-native-file.ini
The Meson build system
Version: 1.11.1
Source dir: /tmp/pip-install-iv5l8kg7/odrpack_bcceb2a076bd442db31fb02adb14ecf0
Build dir: /tmp/pip-install-iv5l8kg7/odrpack_bcceb2a076bd442db31fb02adb14ecf0/.mesonpy-_f61c11h
Build type: native build
Project name: odrpack
Project version: 0.5.0
C++ compiler for the host machine: c++ (gcc 12.2.0 "c++ (Debian 12.2.0-14+deb12u1) 12.2.0")
C++ linker for the host machine: c++ ld.bfd 2.40
Host machine cpu family: aarch64
Host machine cpu: aarch64

../meson.build:14:0: ERROR: Unknown compiler(s): [['gfortran'], ['flang-new'], ['flang'], ['nvfortran'], ['pgfortran'], ['ifort'], ['ifx'], ['g95']]
The following exception(s) were encountered:
Running `gfortran --help` gave "[Errno 2] No such file or directory: 'gfortran'"
Running `gfortran --version` gave "[Errno 2] No such file or directory: 'gfortran'"
Running `gfortran -V` gave "[Errno 2] No such file or directory: 'gfortran'"
Running `flang-new --help` gave "[Errno 2] No such file or directory: 'flang-new'"
Running `flang-new --version` gave "[Errno 2] No such file or directory: 'flang-new'"
Running `flang-new -V` gave "[Errno 2] No such file or directory: 'flang-new'"
Running `flang --help` gave "[Errno 2] No such file or directory: 'flang'"
Running `flang --version` gave "[Errno 2] No such file or directory: 'flang'"
Running `flang -V` gave "[Errno 2] No such file or directory: 'flang'"
Running `nvfortran --help` gave "[Errno 2] No such file or directory: 'nvfortran'"
Running `nvfortran --version` gave "[Errno 2] No such file or directory: 'nvfortran'"
Running `nvfortran -V` gave "[Errno 2] No such file or directory: 'nvfortran'"
Running `pgfortran --help` gave "[Errno 2] No such file or directory: 'pgfortran'"
Running `pgfortran --version` gave "[Errno 2] No such file or directory: 'pgfortran'"
Running `pgfortran -V` gave "[Errno 2] No such file or directory: 'pgfortran'"
Running `ifort --help` gave "[Errno 2] No such file or directory: 'ifort'"
Running `ifort --version` gave "[Errno 2] No such file or directory: 'ifort'"
Running `ifort -V` gave "[Errno 2] No such file or directory: 'ifort'"
Running `ifx --help` gave "[Errno 2] No such file or directory: 'ifx'"
Running `ifx --version` gave "[Errno 2] No such file or directory: 'ifx'"
Running `ifx -V` gave "[Errno 2] No such file or directory: 'ifx'"
Running `g95 --help` gave "[Errno 2] No such file or directory: 'g95'"
Running `g95 --version` gave "[Errno 2] No such file or directory: 'g95'"
Running `g95 -V` gave "[Errno 2] No such file or directory: 'g95'"

A full log can be found at /tmp/pip-install-iv5l8kg7/odrpack_bcceb2a076bd442db31fb02adb14ecf0/.mesonpy-_f61c11h/meson-logs/meson-log.txt
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
pi@openplotter:~ $

Reboot the system
Have the yacht but no spheres in Calibration

I don't understand any of the above but it seems to me the system is missing the module 'minpack' ??

I can confirm the autopilot is engaged. Pypilot is version 0.70 and the imu ICM-20948. 12C is working and shows Address 68

Tom
Reply
#18
I see, yes you would need to "sudo apt install gfortran" before "pip install odrpack"

I recently removed the scipy dependency since it is a bit large for the calibration and odr in it is deprecated.

Instead supporting odrpack with minpack as a fallback.

I am updating the software now to support scipy as before as a fallback if neither odrpack or minpack work.
Reply
#19
Sean,
When I tried the second command I see the following

pi@openplotter:~ $ pip install odrpack
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Tom
Reply
#20
Seems to be working for me now.

RPi4, Macarthur HAT with IMU only.

I can see the IMU data in SignalK

Many thanks for the help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)