Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 877515 - dev-python/scipy 1.9.2 fails to build
Summary: dev-python/scipy 1.9.2 fails to build
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-18 00:41 UTC by Chris Travers
Modified: 2022-11-28 04:54 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,8.06 KB, text/plain)
2022-10-18 00:41 UTC, Chris Travers
Details
emerge --info on package (emerge_info,6.92 KB, text/plain)
2022-10-18 00:41 UTC, Chris Travers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Travers 2022-10-18 00:41:05 UTC
Created attachment 824645 [details]
build.log

Scipy 1.9.1 built and installed so this is not a blocker for me.  However 1.9.2 has not built.  Log and info attached.

The log references an inability to import numpy. I did try reinstalling numpy, and numpy works from python so I conclude this is a problem in the build itself.

The relevant part of the log file (for quick reference) is
>>> Failed to emerge dev-python/scipy-1.9.2, Log file:

>>>  '/var/tmp/portage/dev-python/scipy-1.9.2/temp/build.log'

 * Messages for package dev-python/scipy-1.9.2:

 * ERROR: dev-python/scipy-1.9.2::gentoo failed (compile phase):
 *   Wheel build failed
 * 
 * Call stack:
 *     ebuild.sh, line  122:  Called src_compile
 *   environment, line 3546:  Called distutils-r1_src_compile
 *   environment, line 1745:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  749:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3232:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 2791:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 2789:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 1218:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line 1727:  Called distutils-r1_python_compile
 *   environment, line 1551:  Called distutils_pep517_install '/var/tmp/portage/dev-python/scipy-1.9.2/work/scipy-1.9.2-python3_9/install'
 *   environment, line 2050:  Called die
 * The specific snippet of code:
 *       [[ -n ${wheel} ]] || die "No wheel name returned";
 * 
 * If you need support, post the output of `emerge --info '=dev-python/scipy-1.9.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-python/scipy-1.9.2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-python/scipy-1.9.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/scipy-1.9.2/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-python/scipy-1.9.2/work/scipy-1.9.2'
 * S: '/var/tmp/portage/dev-python/scipy-1.9.2/work/scipy-1.9.2'
 * 
 * The following package has failed to build, install, or execute postinst:
 * 
 *  (dev-python/scipy-1.9.2:0/0::gentoo, ebuild scheduled for merge), Log file:
 *   '/var/tmp/portage/dev-python/scipy-1.9.2/temp/build.log'
 *
Comment 1 Chris Travers 2022-10-18 00:41:46 UTC
Created attachment 824647 [details]
emerge --info on package
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-18 00:42:31 UTC
Program python found: YES (/usr/bin/python3.9)
Found pkg-config: /usr/bin/pkg-config (1.8.0)

../../scipy/meson.build:38:0: ERROR: Command "/usr/bin/python3.9 -c import os; os.chdir(".."); import numpy; print(numpy.get_include())" failed with status 1.

A full log can be found at /var/tmp/portage/dev-python/scipy-1.9.2/work/scipy-1.9.2/.mesonpy-2pon_lut/build/meson-logs/meson-log.txt
Traceback (most recent call last):

What happens when you run:
/usr/bin/python3.9 -c import os; os.chdir(".."); import numpy; print(numpy.get_include())

If you try 3.10 and 3.11, do you get the same result?
Comment 3 Chris Travers 2022-10-18 03:00:27 UTC
chris /etc/portage/package.use # /usr/bin/python3.9 -c "import os; os.chdir(".."); import numpy; print(numpy.get_include())"
  File "<string>", line 1
    import os; os.chdir(..); import numpy; print(numpy.get_include())
                        ^
SyntaxError: invalid syntax
chris /etc/portage/package.use # /usr/bin/python3.10 -c "import os; os.chdir(".."); import numpy; print(numpy.get_include())"
  File "<string>", line 1
    import os; os.chdir(..); import numpy; print(numpy.get_include())
                        ^
SyntaxError: invalid syntax
chris /etc/portage/package.use # /usr/bin/python3.11 -c "import os; os.chdir(".."); import numpy; print(numpy.get_include())"
  File "<string>", line 1
    import os; os.chdir(..); import numpy; print(numpy.get_include())
                        ^
SyntaxError: invalid syntax
Comment 4 Chris Travers 2022-10-18 03:02:29 UTC
Never mind, my quotes were messed up on the last one.

This actually is stranger.  The command succeeds from bash for Python 3.9 and 3.10 but fails on 3.11 with Numpy not being found

chris /etc/portage/package.use # /usr/bin/python3.11 -c 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
chris /etc/portage/package.use # /usr/bin/python3.10 -c 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'
/root/.local/lib/python3.10/site-packages/numpy/core/include
chris /etc/portage/package.use # /usr/bin/python3.9 -c 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'
/usr/lib/python3.9/site-packages/numpy/core/include
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-18 03:06:07 UTC
Maybe related to bug 858425.
Comment 6 Aleksander Zatserkovnyy 2022-10-27 06:50:38 UTC
The same problem.
Solved by emerge scipy without su (from root). It's possible, meson conflicts with user PYTHONPATH (I define PYTHONPATH for me).
Comment 7 Gottfried Munda 2022-11-11 08:29:58 UTC
(In reply to Aleksander Zatserkovnyy from comment #6)
> The same problem.
> Solved by emerge scipy without su (from root). It's possible, meson
> conflicts with user PYTHONPATH (I define PYTHONPATH for me).

I have the same problem and i can support Aleksanders hypotheses that PYTHONPATH has something to do with it. I have PYTHONPATH defined and got the error,

PYTHONPATH="" emerge -av scipy

solved the problem for me.
Comment 8 Larry Pyeatt 2022-11-27 12:18:39 UTC
Same here:

PYTHONPATH="" emerge -1 =dev-python/scipy-1.9.2

fixed it.
Comment 9 Larry Pyeatt 2022-11-28 01:14:04 UTC
Update: After the world rebuild completed, it re-builds without issue.
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-11-28 04:54:52 UTC
Yes, I suspect it finding stuff from /root/.local isn't the best way to build it. However, I'm not sure that we want to reset PYTHONPATH since people may have valid use cases for overriding it.