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

Can't build 3.13b1 on Ubuntu: no module named math #118809

Closed
RobH123 opened this issue May 8, 2024 · 8 comments
Closed

Can't build 3.13b1 on Ubuntu: no module named math #118809

RobH123 opened this issue May 8, 2024 · 8 comments
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@RobH123
Copy link

RobH123 commented May 8, 2024

Bug report

Bug description:

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

CPython versions tested on:

3.13

Operating systems tested on:

Linux

@RobH123 RobH123 added the type-bug An unexpected behavior, bug, or error label May 8, 2024
@AlexWaygood AlexWaygood added the build The build process and cross-build label May 8, 2024
@novaTopFlex

This comment was marked as off-topic.

@hugovk

This comment was marked as off-topic.

@erlend-aasland
Copy link
Contributor

I'm unable to reproduce this on Ubuntu 23.10 on main. Did you install build-essential?

@RobH123
Copy link
Author

RobH123 commented 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-dev Perhaps https://packages.ubuntu.com/search?keywords=libmpdec-dev is telling me that Ubuntu Noble doesn't have it???

@erlend-aasland
Copy link
Contributor

Yes, the libmpdec issue was just fixed on main. You can specify --without-system-libmpdec to mitigate it for now.

@RobH123
Copy link
Author

RobH123 commented 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
Copy link
Author

RobH123 commented 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
Copy link
Contributor

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?

It seems to me this is a devguide issue, yeah. Let's close this as not-planned. Thanks for the report, though.

@erlend-aasland erlend-aasland closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants