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

PyCall broken on M1 Mac and Julia 1.8.2? #1010

Closed
GlenHenshaw opened this issue Oct 7, 2022 · 6 comments
Closed

PyCall broken on M1 Mac and Julia 1.8.2? #1010

GlenHenshaw opened this issue Oct 7, 2022 · 6 comments

Comments

@GlenHenshaw
Copy link

GlenHenshaw commented Oct 7, 2022

Just upgraded to Julia 1.8.2, under macOS 12.6. python is installed via homebrew. I am getting the following error when running update:

julia> import Pkg

julia> Pkg.build("PyCall")
    Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/6e47d11ea2776bc5627421d59cdcc1296c058071/build.log`
    Building PyCall → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/53b8b07b721b77144a0fbbbc2675222ebf40a02d/build.log`
ERROR: Error building `PyCall`:
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

# All requested packages already installed.

Retrieving notices: ...working... done
┌ Info: Using the Python distribution in the Conda package by default.
└ To use a different Python version, set ENV["PYTHON"]="pythoncommand" and re-run Pkg.build("PyCall").
[ Info: Running `conda install -y numpy` in root environment
ERROR: LoadError: Couldn't find libpython; check your PYTHON environment variable.

when digging down, I finally arrive at the following:

dlopen(/Users/glenhenshaw/.julia/conda/3/lib/libpython3.9.dylib) ==> ErrorException("could not load library \"/Users/glenhenshaw/.julia/conda/3/lib/libpython3.9.dylib\"\ndlopen(/Users/glenhenshaw/.julia/conda/3/lib/libpython3.9.dylib, 0x0009): tried: '/Users/glenhenshaw/.julia/conda/3/lib/libpython3.9.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))")
@stevengj
Copy link
Member

stevengj commented Oct 8, 2022

Your libpython is probably for the wrong architecture. You'll need to re-install Conda if you switch from using a Rosetta Julia to the native M1 Julia. rm(homedir() * "/.julia/conda", recursive=true) and try again.

@stevengj stevengj closed this as completed Oct 8, 2022
@AbhimanyuAryan
Copy link

@GlenHenshaw does this also fix this issue? #1017 (comment)

@AbhimanyuAryan
Copy link

I think I also saw this libpython errror. I remove ~/.julia/conda but that didn't fix the issue

@AbhimanyuAryan
Copy link

I have miniconda installed on my mac machine. Is that messing up with PyCall's conda?

@hhaensel
Copy link

hhaensel commented Jan 6, 2023

Maybe. Have you tried

julia> ENV["CONDA_JL_CONDA_EXE"] = "/path/to/miniconda/bin/conda" # change this to the path of the conda executable

pkg> build Conda

More Info is on https://github.com/JuliaPy/Conda.jl

@AbhimanyuAryan
Copy link

@hhaensel I also think it's picking conda env from my ~/minicoda. Not sure though. It has something do with architecture. I didn't get time to debug this properly :(

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

4 participants