Skip to content

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

Closed as not planned
Closed as not planned

Description

@RobH123

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

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on May 8, 2024
  2. novaTopFlex commented on May 9, 2024

    @novaTopFlex
  3. hugovk commented on May 9, 2024

    @hugovk
  4. erlend-aasland commented on May 20, 2024

    @erlend-aasland
    Contributor

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

  5. RobH123 commented on May 20, 2024

    @RobH123
    Author

    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???

  6. erlend-aasland commented on May 20, 2024

    @erlend-aasland
    Contributor

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

  7. RobH123 commented on May 20, 2024

    @RobH123
    Author

    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)'.

  8. RobH123 commented on May 20, 2024

    @RobH123
    Author

    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?

  9. erlend-aasland commented on May 21, 2024

    @erlend-aasland
    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions