conda-forge / miniforge

A conda-forge distribution.
https://conda-forge.org/miniforge
Other
6.43k stars 326 forks source link

Installation then python downgrade causes certificate error on intel MacOS #341

Closed joezuntz closed 2 years ago

joezuntz commented 2 years ago

Solution to issue cannot be found in the documentation.

Issue

When I use the MiniForge installer on Big Sur 11.6.5 , and then immediately install the python 3.9 package to downgrade I get an error message at the end of install during the "Retrieving notices" phase. Afterwards the installation does seem to have completed okay.

Installing other packages instead does not cause this issue.

I can recreate using these commands:

wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh
chmod u+x Miniforge3-MacOSX-x86_64.sh
./Miniforge3-MacOSX-x86_64.sh -b -p ./env
conda install -c conda-forge -y python=3.9

The traceback is:

Retrieving notices: ...working... failed
Traceback (most recent call last):
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/exceptions.py", line 1125, in __call__
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/cli/main.py", line 86, in main_subshell
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/cli/conda_argparse.py", line 93, in do_call
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/notices/core.py", line 75, in wrapper
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/notices/core.py", line 39, in display_notices
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/notices/http.py", line 36, in get_notice_responses
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/notices/http.py", line 39, in <genexpr>
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/concurrent/futures/_base.py", line 621, in result_iterator
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/concurrent/futures/_base.py", line 319, in _result_or_cancel
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/concurrent/futures/_base.py", line 458, in result
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/concurrent/futures/thread.py", line 58, in run
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/notices/http.py", line 42, in <lambda>
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/notices/cache.py", line 37, in wrapper
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/notices/http.py", line 58, in get_channel_notice_response
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/requests/sessions.py", line 600, in get
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/requests/adapters.py", line 460, in send
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/requests/adapters.py", line 263, in cert_verify
OSError: Could not find a suitable TLS CA certificate bundle, invalid path: /Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/certifi/cacert.pem

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jzuntz/src/tmp/conda/env/bin/conda", line 13, in <module>
    sys.exit(main())
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/cli/main.py", line 129, in main
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/exceptions.py", line 1413, in conda_exception_handler
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/exceptions.py", line 1128, in __call__
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/exceptions.py", line 1170, in handle_exception
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/exceptions.py", line 1181, in handle_unexpected_exception
  File "/Users/jzuntz/src/tmp/conda/env/lib/python3.10/site-packages/conda/exceptions.py", line 1251, in print_unexpected_error_report
ModuleNotFoundError: No module named 'conda.cli.main_info'

I can provide the complete stdout if useful. Thanks!

Installed packages

# packages in environment at /Users/jzuntz/src/tmp/conda/env:
#
# Name                    Version                   Build  Channel
brotlipy                  0.7.0           py310h1961e1f_1004    conda-forge
bzip2                     1.0.8                h0d85af4_4    conda-forge
ca-certificates           2022.6.15            h033912b_0    conda-forge
certifi                   2022.6.15       py310h2ec42d9_0    conda-forge
cffi                      1.15.1          py310h96bbf6e_0    conda-forge
charset-normalizer        2.1.1              pyhd8ed1ab_0    conda-forge
colorama                  0.4.5              pyhd8ed1ab_0    conda-forge
conda                     4.14.0          py310h2ec42d9_0    conda-forge
conda-package-handling    1.8.1           py310h1961e1f_1    conda-forge
cryptography              37.0.4          py310h52c3658_0    conda-forge
idna                      3.3                pyhd8ed1ab_0    conda-forge
libffi                    3.4.2                h0d85af4_5    conda-forge
libsqlite                 3.39.2               h5a3d3bf_1    conda-forge
libzlib                   1.2.12               hfe4f2af_2    conda-forge
ncurses                   6.3                  h96cf925_1    conda-forge
openssl                   1.1.1q               hfe4f2af_0    conda-forge
pip                       22.2.2             pyhd8ed1ab_0    conda-forge
pycosat                   0.6.3           py310h1961e1f_1010    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1           py310h2ec42d9_5    conda-forge
python                    3.10.6          ha7b0be1_0_cpython    conda-forge
python_abi                3.10                    2_cp310    conda-forge
readline                  8.1.2                h3899abd_0    conda-forge
requests                  2.28.1             pyhd8ed1ab_0    conda-forge
ruamel_yaml               0.15.80         py310h6c45266_1007    conda-forge
setuptools                65.2.0          py310h2ec42d9_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
tk                        8.6.12               h5dbffcc_0    conda-forge
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
tqdm                      4.64.0             pyhd8ed1ab_0    conda-forge
tzdata                    2022c                h191b570_0    conda-forge
urllib3                   1.26.11            pyhd8ed1ab_0    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h775f41a_0    conda-forge
yaml                      0.2.5                h0d85af4_2    conda-forge

Environment info

active environment : base
    active env location : /Users/jzuntz/src/tmp/conda/env
            shell level : 1
       user config file : /Users/jzuntz/.condarc
 populated config files : /Users/jzuntz/src/tmp/conda/env/.condarc
          conda version : 4.14.0
    conda-build version : not installed
         python version : 3.10.6.final.0
       virtual packages : __osx=11.6.5=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/jzuntz/src/tmp/conda/env  (writable)
      conda av data dir : /Users/jzuntz/src/tmp/conda/env/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/jzuntz/src/tmp/conda/env/pkgs
                          /Users/jzuntz/.conda/pkgs
       envs directories : /Users/jzuntz/src/tmp/conda/env/envs
                          /Users/jzuntz/.conda/envs
               platform : osx-64
             user-agent : conda/4.14.0 requests/2.28.1 CPython/3.10.6 Darwin/20.6.0 OSX/11.6.5
                UID:GID : 502:20
             netrc file : None
           offline mode : False
hmaarrfk commented 2 years ago

Why do you need to change the base environment. This isn't supported.

Please create a conda environment with the version of python you need.

joezuntz commented 2 years ago

That does not appear to be an option with the miniforge installer. Is the correct solution to download an older version of the miniforge installer?

joezuntz commented 2 years ago

I'll rephrase in case I'm using the wrong thing here. I am looking for a stand-alone installer script that creates an environment with python 3.9 in it. The latest miniforge installer script creates one with python 3.10 - it sounds like it's not possible to run that and then downgrade to python 3.9, and that the right thing to do is then start with an older installer script?

(Incidentally, the README for this repo says that the default installer installs 3.9, but it seems to be 3.10).

hmaarrfk commented 2 years ago

Yes. This is not a supported use case.

You can use the machinery here to build your own installers that fit your specific needs.

You can the specified version.

isuruf commented 2 years ago

@joezuntz, the solution is to create a new environment with conda create -n py39 python=3.9