这是indexloc提供的服务,不要输入任何密码
Skip to content

SciPy causes trouble on my Linux Installation #48

@StefanPofahl

Description

@StefanPofahl

Hi,
thanks for the fantastic package. It might be that it is not entirely an SciPy.jl issue.
Following fails as well, no matter, if I use JuliaRTS or Julia v1.8.0:

using PyCall
py"""
from scipy import signal
"""

But maybe you know better to whom it might concern.

Below is my error output. I hope it helps.

Regards,

Stefan

ERROR: InitError: PyError (PyImport_ImportModule

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

PyCall is currently configured to use the Python version at:

/usr/bin/python3

and you should use whatever mechanism you usually use (apt-get, pip, conda,
etcetera) to install the Python package containing the scipy module.

One alternative is to re-configure PyCall to use a different Python
version on your system: set ENV["PYTHON"] to the path/name of the python
executable you want to use, run Pkg.build("PyCall"), and re-launch Julia.

Another alternative is to configure PyCall to use a Julia-specific Python
distribution via the Conda.jl package (which installs a private Anaconda
Python distribution), which has the advantage that packages can be installed
and kept up-to-date via Julia.  As explained in the PyCall documentation,
set ENV["PYTHON"]="", run Pkg.build("PyCall"), and re-launch Julia. Then,
To install the scipy module, you can use `pyimport_conda("scipy", PKG)`,
where PKG is the Anaconda package that contains the module scipy,
or alternatively you can use the Conda package directly (via
`using Conda` followed by `Conda.add` etcetera).

) <class 'ModuleNotFoundError'>
ModuleNotFoundError("No module named 'scipy'")

Stacktrace:
  [1] pyimport(name::String)
    @ PyCall ~/.julia/packages/PyCall/7a7w0/src/PyCall.jl:550
  [2] pyimport_conda(modulename::String, condapkg::String, channel::String)
    @ PyCall ~/.julia/packages/PyCall/7a7w0/src/PyCall.jl:708
  [3] pyimport_conda
    @ ~/.julia/packages/PyCall/7a7w0/src/PyCall.jl:707 [inlined]
  [4] __init__()
    @ SciPy ~/.julia/packages/SciPy/uXpRL/src/SciPy.jl:419
  [5] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base ./loading.jl:696
  [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base ./loading.jl:782
  [7] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1020
  [8] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:936
  [9] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:923
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
    @ Base ./loading.jl:1116
 [12] include_string(m::Module, txt::String, fname::String)
    @ Base ./loading.jl:1126
 [13] invokelatest(::Any, ::Any, ::Vararg{Any, N} where N; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./essentials.jl:708
 [14] invokelatest(::Any, ::Any, ::Vararg{Any, N} where N)
    @ Base ./essentials.jl:706
 [15] inlineeval(m::Module, code::String, code_line::Int64, code_column::Int64, file::String; softscope::Bool)
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.7.5/scripts/packages/VSCodeServer/src/eval.jl:233
 [16] (::VSCodeServer.var"#64#68"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.7.5/scripts/packages/VSCodeServer/src/eval.jl:157
 [17] withpath(f::VSCodeServer.var"#64#68"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String)
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.7.5/scripts/packages/VSCodeServer/src/repl.jl:249
 [18] (::VSCodeServer.var"#63#67"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.7.5/scripts/packages/VSCodeServer/src/eval.jl:155
 [19] hideprompt(f::VSCodeServer.var"#63#67"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.7.5/scripts/packages/VSCodeServer/src/repl.jl:38
 [20] (::VSCodeServer.var"#62#66"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.7.5/scripts/packages/VSCodeServer/src/eval.jl:126
 [21] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging ./logging.jl:491
 [22] with_logger
    @ ./logging.jl:603 [inlined]
 [23] (::VSCodeServer.var"#61#65"{VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.7.5/scripts/packages/VSCodeServer/src/eval.jl:225
 [24] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
 [25] invokelatest(::Any)
    @ Base ./essentials.jl:706
 [26] macro expansion
    @ ~/.vscode/extensions/julialang.language-julia-1.7.5/scripts/packages/VSCodeServer/src/eval.jl:34 [inlined]
 [27] (::VSCodeServer.var"#59#60")()
    @ VSCodeServer ./task.jl:417
during initialization of module SciPy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions