-
Notifications
You must be signed in to change notification settings - Fork 190
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
pyimport("scipy.fft") fails for scipy v1.8.1 #990
Comments
This is the underlying error:
i.e. it is an incompatibility with the C++ standard library — Julia links one version, Not much we can do about this in PyCall. You'll need either a different version of Julia or a different version of pypocketfft, built with compatible versions of |
Ah okay, so this has the same solution as #722 (comment), namely $ LD_PRELOAD=$HOME/.julia/conda/3/lib/libstdc++.so julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.7.3 (2022-05-06)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ | julia> using PyCall
julia> pyimport("scipy.fft")
PyObject <module 'scipy.fft' from '/home/sethaxen/.julia/conda/3/lib/python3.9/site-packages/scipy/fft/__init__.py'> Is this the best advice I can give to users of my package? It seems that this incompatibility of Julia's libstdc++ with some Python package's can happen at any time. In this case, a new Julia version has even been released (v1.8.0-rc1) since scipy v1.8.1 was released, and has the same error. |
@sethaxen Thank you for your workaround, this fixes (for now) my setup (both with Julia 1.7 and 1.8), I had a conda package "kneed" that dependend on scipy.fft, with the above error. I can confirm that the PRELOAD trick works. |
I can see a difference between MS Windows and Linux, on Windows, I do not observe an issue. |
Here my code snippet that fails:
and here the error output:
and if I issue the last script the output is:
|
@StefanPofahl Note that to get around the fft GLIBC issue I use: using PyCall
using Conda
Conda.add("gcc=12.1.0"; channel="conda-forge")
Conda.add("scikit-image")
# Pin this version, to avoid clashes with libgcc.34
Conda.add("scipy=1.8.0") |
@StefanPofahl for completeness, in my packages where I use PyCall/scipy, I have with #./deps/build.jl
using Pkg;
using Logging;
@info "Initiating build"
ENV["PYTHON"] = ""
Pkg.add("Conda")
Pkg.add("PyCall")
Pkg.build("PyCall")
Pkg.build("Conda")
using PyCall
using Conda
## Add the two packages we need
Conda.add("gcc=12.1.0"; channel="conda-forge")
Conda.add("scikit-image")
# Pin this version, to avoid clashes with libgcc.34
Conda.add("scipy=1.8.0") Note that this is failing due to an unrelated issue with Conda on MacOs (I'm told the latest Mac updates fix that), other than that this works for me across systems. |
Hi bencardoen |
glad it was of use :-) |
Hi @bencardoen , I will have a look on PackageCompiler.jl. Thanks! |
If we install scipy v1.8.1 in the Julia-specific conda environment and call
pyimport("scipy.fft")
, we get the following error: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, thenpyimport("scipy.fft")
also runs with no problem.The text was updated successfully, but these errors were encountered: