Skip to content

Error when using PythonCall attached to a previous Conda environment. #224

Closed
@martinmestre

Description

@martinmestre

Hello,
I would be very gratefull to understand what is the problem. I followed the instructions:

julia > ENV["JULIA_CONDAPKG_BACKEND"] = "System"
julia > ENV["JULIA_CONDAPKG_EXE"] = "/home/mmestre/.conda/envs/cosmos/bin/python3.9"

Then I install PythonCall.

(RiosDelCosmos) pkg> st
      Status `~/casa/work/2022/RiosDelCosmos/Project.toml`
  [6099a3de] PythonCall v0.9.6

When I try to use it I get an error (I do have astropy installed in the cosmos environment):

julia> using PythonCall
julia> ast = pyimport("astropy")
ERROR: Python: ModuleNotFoundError: No module named 'astropy'
Python stacktrace: none
Stacktrace:
 [1] pythrow()
   @ PythonCall ~/.julia/packages/PythonCall/DqZCE/src/err.jl:94
 [2] errcheck
   @ ~/.julia/packages/PythonCall/DqZCE/src/err.jl:10 [inlined]
 [3] pyimport(m::String)
   @ PythonCall ~/.julia/packages/PythonCall/DqZCE/src/concrete/import.jl:11
 [4] top-level scope
   @ REPL[5]:1

I also tried with
julia > ENV["JULIA_CONDAPKG_EXE"] = "/home/mmestre/.conda/envs/cosmos/bin/python"
obtaining the same result.
Thank you very much in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions