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

Env creation from python 3.7 not working M1 Apple Silicon Mac (Miniconda 3) #12206

Closed
2 tasks done
SohelKabir opened this issue Jan 2, 2023 · 8 comments
Closed
2 tasks done
Labels
type::bug describes erroneous operation, use severity::* to classify the type

Comments

@SohelKabir
Copy link

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

tried to create an env with these commands both are failing on Apple Silicon Mac.

conda create -n myenv python=3.7

and with channel conda-forge.

conda create -n myenvenv -c conda-forge python=3.7

both commnad resulting same error!


Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed

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

  - python=3.7

Current channels:

  - 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
  - https://conda.anaconda.org/conda-forge/osx-arm64
  - https://conda.anaconda.org/conda-forge/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.

Conda Info

active environment : base
    active env location : /Users/sohelkabir/miniconda3
            shell level : 1
       user config file : /Users/sohelkabir/.condarc
 populated config files : /Users/sohelkabir/.condarc
          conda version : 22.11.1
    conda-build version : not installed
         python version : 3.10.8.final.0
       virtual packages : __archspec=1=arm64
                          __osx=13.1=0
                          __unix=0=0
       base environment : /Users/sohelkabir/miniconda3  (writable)
      conda av data dir : /Users/sohelkabir/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : 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
                          https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/sohelkabir/miniconda3/pkgs
                          /Users/sohelkabir/.conda/pkgs
       envs directories : /Users/sohelkabir/miniconda3/envs
                          /Users/sohelkabir/.conda/envs
               platform : osx-arm64
             user-agent : conda/22.11.1 requests/2.28.1 CPython/3.10.8 Darwin/22.2.0 OSX/13.1
                UID:GID : 501:20
             netrc file : None
           offline mode : False

Conda Config

==> /Users/sohelkabir/.condarc <==
channel_priority: disabled
channels:
  - defaults
  - conda-forge

Conda list

# packages in environment at /Users/sohelkabir/miniconda3:
#
# Name                    Version                   Build  Channel
brotlipy                  0.7.0           py310h1a28f6b_1002    defaults
bzip2                     1.0.8                h620ffc9_4    defaults
ca-certificates           2022.10.11           hca03da5_0    defaults
certifi                   2022.12.7       py310hca03da5_0    defaults
cffi                      1.15.1          py310h80987f9_3    defaults
charset-normalizer        2.0.4              pyhd3eb1b0_0    defaults
conda                     22.11.1         py310hca03da5_4    defaults
conda-content-trust       0.1.3           py310hca03da5_0    defaults
conda-package-handling    1.9.0           py310h1a28f6b_1    defaults
cryptography              38.0.1          py310h834c97f_0    defaults
idna                      3.4             py310hca03da5_0    defaults
libffi                    3.4.2                hca03da5_6    defaults
ncurses                   6.3                  h1a28f6b_3    defaults
openssl                   1.1.1s               h1a28f6b_0    defaults
pip                       22.3.1          py310hca03da5_0    defaults
pluggy                    1.0.0           py310hca03da5_1    defaults
pycosat                   0.6.4           py310h1a28f6b_0    defaults
pycparser                 2.21               pyhd3eb1b0_0    defaults
pyopenssl                 22.0.0             pyhd3eb1b0_0    defaults
pysocks                   1.7.1           py310hca03da5_0    defaults
python                    3.10.8               hc0d8a6c_1    defaults
python.app                3               py310h1a28f6b_0    defaults
readline                  8.2                  h1a28f6b_0    defaults
requests                  2.28.1          py310hca03da5_0    defaults
ruamel.yaml               0.17.21         py310h1a28f6b_0    defaults
ruamel.yaml.clib          0.2.6           py310h1a28f6b_1    defaults
setuptools                65.5.0          py310hca03da5_0    defaults
six                       1.16.0             pyhd3eb1b0_1    defaults
sqlite                    3.40.0               h7a7dc30_0    defaults
tk                        8.6.12               hb8d0fd4_0    defaults
toolz                     0.12.0          py310hca03da5_0    defaults
tqdm                      4.64.1          py310hca03da5_0    defaults
tzdata                    2022g                h04d1e81_0    defaults
urllib3                   1.26.13         py310hca03da5_0    defaults
wheel                     0.37.1             pyhd3eb1b0_0    defaults
xz                        5.2.8                h80987f9_0    defaults
zlib                      1.2.13               h5a0b063_0    defaults

Additional Context

No response

@SohelKabir SohelKabir added the type::bug describes erroneous operation, use severity::* to classify the type label Jan 2, 2023
@SohelKabir
Copy link
Author

So the problem was there's no native build for python below 3.8 for Apple Silicon. As a workaround you can follow this steps to emulate x86_64 architecture in M1 Apple Silicon (ARM).

## create empty environment
conda create -n py37

## activate
conda activate py37

## use x86_64 architecture channel(s)
conda config --env --set subdir osx-64

## install python, numpy, etc. (add more packages here...)
conda install python=3.7

Solution from : https://stackoverflow.com/questions/70205633/cannot-install-python-3-7-on-osx-arm64

@kelvin7171
Copy link

We said osx-arm64 not osx-x86_64, clearly this doesn't solve the problem

@Wallpix
Copy link

Wallpix commented Jul 12, 2023

We said osx-arm64 not osx-x86_64, clearly this doesn't solve the problem

Have you tried it? Works just fine on my M1 MacBook.

@GeneCodeSavvy
Copy link

@SohelKabir what are the pros and cons of emulating a different architecture on the apple silicon?

@realJaydenCheng
Copy link

We said osx-arm64 not osx-x86_64, clearly this doesn't solve the problem

true, "zsh: bad CPU type in executable: python"

@SamuelGong
Copy link

We said osx-arm64 not osx-x86_64, clearly this doesn't solve the problem

true, "zsh: bad CPU type in executable: python"

The same here: I am using M3 Pro chip, and this yields zsh: illegal hardware instruction

@Wallpix
Copy link

Wallpix commented Mar 29, 2024

What you have to understand is that 3.7 was released before the ARM Macs were released. So nobody ever compiled 3.7 for ARM. You don't really have a choice to use emulation (Rosetta) thus forcing x86 to be able to use 3.7. And honestly why would you even bother with such an old and unsupported version anyways. 3.9.1 was the first release to natively support ARM. We're on 3.12 now for LTS!

@SamuelGong
Copy link

Totally understand your point :) I was just trying some others' code dating back to 2021, which relies on an ancient version of Tensorflow that can only run with Python 3.7 LOL Sine this is impossible I have given up this idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug describes erroneous operation, use severity::* to classify the type
Projects
Archived in project
Development

No branches or pull requests

6 participants