JuliaPy / JuliaPy/PyCall.jl

pyimport("scipy.fft") fails for scipy v1.8.1

Open
#990 10 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
1.5k
Forks
186
PR merge metrics
No merged PRs in 30d

Description

If we install scipy v1.8.1 in the Julia-specific conda environment and call `pyimport("scipy.fft")`, we get the following error:

```julia
julia> using PyCall

julia> pyimport("scipy.fft")
ERROR: PyError (PyImport_ImportModule

The Python package scipy.fft could not be imported by pyimport. Usually this means
that you did not install scipy.fft in the Python version being used by PyCall.

PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package. To install the scipy.fft module, you can
use `pyimport_conda("scipy.fft", PKG)`, where PKG is the Anaconda
package that contains the module scipy.fft, or alternatively you can use the
Conda package directly (via `using Conda` followed by `Conda.add` etcetera).

Alternatively, if you want to use a different Python distribution on your
system, such as a system-wide Python (as opposed to the Julia-specific Python),
you can re-configure PyCall with that Python. As explained in the PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.

)
ImportError("/home/sethaxen/.julia/juliaup/julia-1.7.3+0~x64/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/sethaxen/.julia/conda/3/lib/python3.9/site-packages/scipy/fft/_pocketfft/pypocketfft.cpython-39-x86_64-linux-gnu.so)")
File "/home/sethaxen/.julia/conda/3/lib/python3.9/site-packages/scipy/fft/__init__.py", line 91, in
from ._helper import next_fast_len
File "/home/sethaxen/.julia/conda/3/lib/python3.9/site-packages/scipy/fft/_helper.py", line 3, in
from ._pocketfft import helper as _helper
File "/home/sethaxen/.julia/conda/3/lib/python3.9/site-packages/scipy/fft/_pocketfft/__init__.py", line 3, in
from .basic import *
File "/home/sethaxen/.julia/conda/3/lib/python3.9/site-packages/scipy/fft/_pocketfft/basic.py", line 6, in
from . import pypocketfft as pfft

Stacktrace:
[1] pyimport(name::String)
@ PyCall ~/.julia/packages/PyCall/7a7w0/src/PyCall.jl:550
[2] top-level scope
@ REPL[3]:1
```

If we manually launch the Julia-specific conda's Python executable and call `import scipy.fft`, it loads with no problem. If we instead install scipy v1.8.0, then `pyimport("scipy.fft")` also runs with no problem.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.