conda-env create is failing with generic error message "An unexpected error has occurred."

Viewed 404

I am an inexperienced python coder, and have been trying to get my Macbook M1 to learn tensorflow. I ran into issues that others have experienced due to the M1 having challenges with the particular python interpreter, and I followed the steps suggested by Paul Torres here https://medium.com/codex/installing-tensorflow-on-m1-macs-958767a7a4b3

These steps appeared to go off without a hitch up until creating the virtual env using conda env create --file=COPIED_PATH_TO_THE.YML_FILE --name=YOUR_ENVIRONMENT_NAME

The 'helpful' report compiled by Conda is below. If you can spot any obvious cause of the issue I would be very grateful.

`$ /Users/andrewwalker/miniforge3/bin/conda-env create --file=/Users/andrewwalker/Desktop/tensorconfig.yml --name=arm64test`

  environment variables:
                 CIO_TEST=<not set>
  CONDA_AUTO_UPDATE_CONDA=false
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=/Users/andrewwalker/miniforge3/bin/conda
             CONDA_PREFIX=/Users/andrewwalker/miniforge3
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=/Users/andrewwalker/miniforge3/bin/python
               CONDA_ROOT=/Users/andrewwalker/miniforge3
              CONDA_SHLVL=1
           CURL_CA_BUNDLE=<not set>
                     PATH=/Users/andrewwalker/miniforge3/bin:/Users/andrewwalker/miniforge3/bin:
                          /Users/andrewwalker/miniforge3/condabin:/Library/Frameworks/Python.fra
                          mework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

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


An unexpected error has occurred. Conda has prepared the above report.```
1 Answers

Thanks to anyone who came and took a look at this question. For anyone that has found my question because of the same issue, it was caused by not correctly saving the .yml file.

I obviously was a bit of a rookie Mac user still - I opened text editor, saved the file and then went into Finder and just renamed the file as environment.yml

That doesn't work.

You must open your file in text editor, select Format - Make Plain text. Then you click save and you can save the file as myfile.yml right there. This is a well-formatted yml for conda and it worked for me.

Hope that helps you too - this environment setup feels like a black box and is frustrating, but when it works you feel clever :).

Related