question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Conda installation failing in m1 macbook

See original GitHub issue

😵 Describe the installation problem

I created a new env with a fresh pyorch installation and I am not able to install pyg with conda in my MacBook with an m1 chip. I get the following error:

conda install pyg -c pyg
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - pyg

Current channels:

  - https://conda.anaconda.org/pyg/osx-arm64
  - https://conda.anaconda.org/pyg/noarch
  - https://repo.anaconda.com/pkgs/main/osx-arm64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/osx-arm64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Environment

  • PyG version: The current one.
  • PyTorch version: 1.11
  • OS: Mac os
  • Python version: 3.8
  • CUDA/cuDNN version: None
  • How you installed PyTorch and PyG (conda, pip, source): conda
  • Any other relevant information (e.g., version of torch-scatter): Macbook pro with an M1 chip

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bkreidercommented, Jun 3, 2022

@dhorka I don’t have an M1 mac, but my colleague has given me some tips for m1 and conda. I have not tested these things out.

Running OSX-64 conda packages:

Rosetta2 will translate the x86 binaries and libraries on first use. This will result in a pause before starting an x86 build of Python or importing a library for the first time, but the translated binaries are cached by the operating system and used automatically in the future.

Check your activated environment to see what architecture it is using:
python -c 'import platform; print(platform.machine())'

Create an environment that uses osx-arm64 (you want the other way around):

creating an environment for the non-base platform is to do the following:

conda create -n m1 
conda activate m1
# set the platform in just this environment (--env) to osx-arm64
conda config --env --set subdir osx-arm64
# all future installs and updates will use osx-arm64 packages
conda install python=3.8 notebook pandas

The use of --env with conda config sets the configuration just for the active environment, and not the base environment. (Note that the example assumes your base environment is x86-64 and you want an osx-arm64 environment. If the reverse is true, then you need to set the subdir config to x86-64 instead.)

In your case, you want to do the opposite. Set the subdir to x86-64.

What about AVX?

One potential problem you will encounter are packages which were compiled to use AVX instructions and do not do a runtime check for AVX support. Anaconda builds of NumPy, SciPy, TensorFlow, and other libraries do not require AVX support on the CPU, although in some cases they will take advantage of AVX if detected at runtime. Other sources of packages (like TensorFlow wheels) are compiled with AVX support as a requirement. Rosetta2 cannot translate AVX instructions, so when your program hits one of them, you will get an “illegal hardware instruction” error at runtime. If you have any packages like this in your conda environment, they will not work on an ARM-based Mac.

0reactions
dhorkacommented, Apr 27, 2022

Thanks! For some reason, I was able to install it in the past using conda and pip, however, I am not able to reproduce it. I will try to do the installation from source.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble installing anaconda on new M1 mac #3308 - GitHub
I just tried installing anaconda on my new M1 mac with brew install --cask ... 05.2022 version of anaconda, so I am surprised...
Read more >
After installation of Anaconda, this erro… - Apple Community
After installation of Anaconda, this error occurs every time I open MAC terminal. I'm using Mac pro M1. I've seen the other people...
Read more >
python 3.x - Anaconda M1 Mac Install Issues - Stack Overflow
I tried using the command line installer and it doesn't work either. Is there any way to safely remove Anaconda and the Anaconda...
Read more >
Installing on macOS - Anaconda Documentation
Click Install to install Anaconda in the opt folder in your user directory (recommended). Once the install is complete, click Continue.
Read more >
Conda install fails macOS 12.5.1 - #2 by colinbrislawn
Hello, I just got a new computer (MacBook Pro M1 2021) and am trying to install Qiime2 2022.2 with conda. When I run:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found