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

Installation issue macOS(Intel) in the case of PyCall.conda is true #71

Open
terasakisatoshi opened this issue Nov 8, 2022 · 3 comments

Comments

@terasakisatoshi
Copy link
Collaborator

#48 (linux installation)

It seems there is a similar issue that happens on macOS (Intel) ʅ(◞‿◟)ʃ

u               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.2 (2022-09-29)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using PyCall

julia> PyCall.conda
true

julia> pyimport("scipy")
INTEL MKL ERROR: dlopen(/Users/terasakisatoshi/.julia/conda/3/lib/libmkl_intel_thread.1.dylib, 0x0009): Library not loaded: '@rpath/libiomp5.dylib'
  Referenced from: '/Users/terasakisatoshi/.julia/conda/3/lib/libmkl_intel_thread.1.dylib'
  Reason: tried: '/Applications/Julia-1.8.app/Contents/Resources/julia/bin/../lib/libiomp5.dylib' (no such file), '/usr/local/lib/libiomp5.dylib' (no such file), '/usr/lib/libiomp5.dylib' (no such file).
Intel MKL FATAL ERROR: Cannot load libmkl_intel_thread.1.dylib.

"'/usr/lib/libiomp5.dylib' (no such file)"

Ref JuliaPy/PyCall.jl#895

So far I have no idea how to avoid the error.

@terasakisatoshi
Copy link
Collaborator Author

Fortunately, we can import scipy on windows 😅

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.2 (2022-09-29)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf26 (2022-09-29 15:21 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, icelake-client)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_PROJECT = @.

julia> using PyCall; scipy = pyimport("scipy");

julia> PyCall.conda
true

julia> scipy.__version__
"1.9.3"

@terasakisatoshi
Copy link
Collaborator Author

(´・ω・`)つ 💊

import PyCall
PyCall.Conda.rm("mkl")
PyCall.Conda.add("nomkl")
PyCall.Conda.add("scipy=1.8.0"; channel="conda-forge") # we also could set "scipy=1.9.3"

Ref: JuliaPy/PyPlot.jl#315 (comment)

(It actually works, however, I'm not sure this is the best solution so far)

@terasakisatoshi
Copy link
Collaborator Author

🤔 Should we add in deps/build.jl

using PyCall
if PyCall.conda
    if Sys.islinux() && ...
        ...
    end
    if Sys.isapple() && Sys.ARCH === :x86_64
        buf = IOBuffer()
        PyCall.Conda.export_list(buf)
        for s in buf |> take! |> String |> split
            if occursin(r"^mkl=", s)
                PyCall.Conda.rm("mkl")
            end
        end
        PyCall.Conda.add("nomkl")
        PyCall.Conda.add("scipy=1.8.0"; channel="conda-forge")
    end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant