You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't build 3.13b1 on Ubuntu: no module named math #118809
After successfully running ./configure --enable-optimizations on Ubuntu 23.10
~/Downloads/Python-3.13.0b1$ make
Running code to generate profile data (this can take a while):
# First, we need to create a clean build with profile generation
# enabled.
make profile-gen-stamp
make[1]: Entering directory '/home/me/Downloads/Python-3.13.0b1'
make[1]: 'profile-gen-stamp' is up to date.
make[1]: Leaving directory '/home/me/Downloads/Python-3.13.0b1'
# Next, run the profile task to generate the profile information.
./python -m test --pgo --timeout=
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/robert/Downloads/Python-3.13.0b1/Lib/test/__main__.py", line 1, in <module>
from test.libregrtest.main import main
File "/home/robert/Downloads/Python-3.13.0b1/Lib/test/libregrtest/main.py", line 2, in <module>
import random
File "/home/robert/Downloads/Python-3.13.0b1/Lib/random.py", line 53, in <module>
from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
ModuleNotFoundError: No module named 'math'
make: *** [Makefile:886: profile-run-stamp] Error 1
Thanks for looking at this. 'build-essential is already the newest version (12.10ubuntu1)' But wouldn't ./configure have caught that if it was missing? I've built Python3.12 many times in the past, so it's likely something new required by 3.13.
Ok, I've upgraded to 24.04 since first submitting this, so did a 'make clean' and './configure --enable-optimizations' and got a lot further (for some reason that I don't understand), but after more research, I suspect the culprit is libmpdec-dev. (After lots of compiling, I now get 'no module named _decimal'.)
I tried to adapt the instructions and follow the suggestions (including enabling the source repo), but still ended up with: Unable to locate package libmpdec-dev Perhaps https://packages.ubuntu.com/search?keywords=libmpdec-dev is telling me that Ubuntu Noble doesn't have it???
Activity
novaTopFlex commentedon May 9, 2024
hugovk commentedon May 9, 2024
erlend-aasland commentedon May 20, 2024
I'm unable to reproduce this on Ubuntu 23.10 on
main. Did you installbuild-essential?RobH123 commentedon May 20, 2024
Thanks for looking at this. 'build-essential is already the newest version (12.10ubuntu1)' But wouldn't ./configure have caught that if it was missing? I've built Python3.12 many times in the past, so it's likely something new required by 3.13.
Ok, I've upgraded to 24.04 since first submitting this, so did a 'make clean' and './configure --enable-optimizations' and got a lot further (for some reason that I don't understand), but after more research, I suspect the culprit is libmpdec-dev. (After lots of compiling, I now get 'no module named _decimal'.)
Unfortunately, the instructions at https://devguide.python.org/getting-started/setup-building/#build-dependencies aren't really correct for recent Ubuntu versions, e.g., Ubuntu now uses a folder sources.list.d/ rather than a file /etc/apt/sources.list.
I tried to adapt the instructions and follow the suggestions (including enabling the source repo), but still ended up with:
Unable to locate package libmpdec-devPerhaps https://packages.ubuntu.com/search?keywords=libmpdec-dev is telling me that Ubuntu Noble doesn't have it???erlend-aasland commentedon May 20, 2024
Yes, the libmpdec issue was just fixed on
main. You can specify--without-system-libmpdecto mitigate it for now.RobH123 commentedon May 20, 2024
Hmmh, we seem to be getting there slowly, thanks. (I assumed the above parameter goes on the './configure --enable-optimizations' line.)
Now 'test test_sqlite3 failed' yet 'libsqlite3-dev is already the newest version (3.45.1-1ubuntu2)'.
RobH123 commentedon May 20, 2024
BTW, should I submit a documentation issue for https://devguide.python.org/getting-started/setup-building/#build-dependencies (see #118809 (comment) above). If so, where should that be done?
erlend-aasland commentedon May 21, 2024
It seems to me this is a devguide issue, yeah. Let's close this as not-planned. Thanks for the report, though.