Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.12 - No module named ‘imp’ #28798

Open
PeterJBurke opened this issue Dec 3, 2024 · 1 comment
Open

Python 3.12 - No module named ‘imp’ #28798

PeterJBurke opened this issue Dec 3, 2024 · 1 comment

Comments

@PeterJBurke
Copy link

PeterJBurke commented Dec 3, 2024

https://discuss.ardupilot.org/t/python-3-12-no-module-named-imp/123459

Bug report

Issue details
On Ubuntu 24.10, Ardupilot will not install using the
install-prereqs-ubuntu.sh
script.

Please describe the problem
It appears the imp module has been deprecated and removed in python 3.12, the default version of python in Ubuntu 24.04.
This makes Ardupilot not compile.
Can the developers replace "imp" with "mportlib" in the compile code?

Version
What version was the issue encountered with
Arducopter 4.5.7

Platform
[x ] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine

Airframe type
What type of airframe (flying wing, glider, hex, Y6, octa etc)

Hardware type
What autopilot hardware was used? (Pixhawk, Cube, Pixracer, Navio2, etc)

Logs
Please provide a link to any relevant logs that show the issue
On a brand new Ubuntu instance on Amazon (fresh out of the box), I typed in these commands: (following the directions here https://ardupilot.org/dev/docs/building-setup-linux.html)
1 sudo apt-get update
2 sudo apt-get install git
3 sudo apt-get install gitk git-gui
4 git clone --recurse-submodules https://github.com/your-github-userid/ardupilot
5 cd ardupilot
6 git clone --recurse-submodules https://github.com/peterjburke/ardupilot
7 cd ardupilot
8 Tools/environment_install/install-prereqs-ubuntu.sh -y
9 . ~/.profile
10 ./waf configure --board MatekH743
11 history

Then I get this error:
./waf configure --board MatekH743
/home/ubuntu/ardupilot/modules/waf/waflib/Utils.py:733: SyntaxWarning: invalid escape sequence '\d'
return re.split('\d+$', s)[0]
/home/ubuntu/ardupilot/modules/waf/waflib/ConfigSet.py:14: SyntaxWarning: invalid escape sequence '\ '
re_imp = re.compile('^(#)?([^#=]?)\ =\ (.?)$', re.M)
/home/ubuntu/ardupilot/modules/waf/waflib/ansiterm.py:267: SyntaxWarning: invalid escape sequence '['
ansi_tokens = re.compile('(?:\x1b[([0-9?;]
)([a-zA-Z])|([^\x1b]+))')
/home/ubuntu/ardupilot/modules/waf/waflib/Context.py:610: SyntaxWarning: invalid escape sequence '_'
"""
Traceback (most recent call last):
File "/home/ubuntu/ardupilot/modules/waf/waf-light", line 166, in
from waflib import Scripting
File "/home/ubuntu/ardupilot/modules/waf/waflib/Scripting.py", line 10, in
from waflib import Utils, Configure, Logs, Options, ConfigSet, Context, Errors, Build, Node
File "/home/ubuntu/ardupilot/modules/waf/waflib/Configure.py", line 16, in
from waflib import ConfigSet, Utils, Options, Logs, Context, Build, Errors
File "/home/ubuntu/ardupilot/modules/waf/waflib/Options.py", line 14, in
from waflib import Logs, Utils, Context, Errors
File "/home/ubuntu/ardupilot/modules/waf/waflib/Context.py", line 9, in
import os, re, imp, sys
ModuleNotFoundError: No module named 'imp'

@PeterJBurke
Copy link
Author

Update:
I noticed that the Docker compile file still points to Ubuntu 22.04.
I used Ubuntu 22.04 stock (also available as an instance from Amazon EC2), and the compile worked. (Not docker, just straight compile). So that is a workaround for now, to use Ubuntu 22.04 instead of Ubuntu 24.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants