skip to Main Content

For some background, I am using a DGX system by using VS Code’s Remote SSH and my local machine is a Mac.

My code requires scipy and I was trying to install it but whenever I’m trying to install anything with pip or conda I am getting some sort of SSL Error.
Here is what I have tried:

  1. (myenv) [f20220244@masterdgx1 params]$ conda install scipy
Collecting package metadata (current_repodata.json): failed

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1079, in __call__
        return func(*args, **kwargs)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/cli/main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/cli/conda_argparse.py", line 83, in do_call
        return getattr(module, func_name)(args, parser)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/cli/main_install.py", line 20, in execute
        install(args, parser, 'install')
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/cli/install.py", line 261, in install
        unlink_link_transaction = solver.solve_for_transaction(
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 114, in solve_for_transaction
        unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 157, in solve_for_diff
        final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 262, in solve_final_state
        ssc = self._collect_all_metadata(ssc)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/common/io.py", line 88, in decorated
        return f(*args, **kwds)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 425, in _collect_all_metadata
        index, r = self._prepare(prepared_specs)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 1020, in _prepare
        reduced_index = get_reduced_index(self.prefix, self.channels,
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/index.py", line 276, in get_reduced_index
        new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs,
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 120, in query_all
        result = tuple(concat(executor.map(subdir_query, channel_urls)))
      File "/opt/apps/anaconda3/lib/python3.8/concurrent/futures/_base.py", line 611, in result_iterator
        yield fs.pop().result()
      File "/opt/apps/anaconda3/lib/python3.8/concurrent/futures/_base.py", line 439, in result
        return self.__get_result()
      File "/opt/apps/anaconda3/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
        raise self._exception
      File "/opt/apps/anaconda3/lib/python3.8/concurrent/futures/thread.py", line 57, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 112, in <lambda>
        subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query(
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 125, in query
        self.load()
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 189, in load
        _internal_state = self._load()
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 291, in _load
        _internal_state = self._process_raw_repodata_str(raw_repodata_str)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 364, in _process_raw_repodata_str
        json_obj = json.loads(raw_repodata_str or '{}')
      File "/opt/apps/anaconda3/lib/python3.8/json/__init__.py", line 357, in loads
        return _default_decoder.decode(s)
      File "/opt/apps/anaconda3/lib/python3.8/json/decoder.py", line 337, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/opt/apps/anaconda3/lib/python3.8/json/decoder.py", line 353, in raw_decode
        obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 88 (char 87)

`$ /opt/apps/anaconda3/bin/conda install scipy`

  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=myenv
                CONDA_EXE=/opt/apps/anaconda3/bin/conda
             CONDA_PREFIX=/home/f20220244/.conda/envs/myenv
           CONDA_PREFIX_1=/opt/apps/anaconda3
    CONDA_PROMPT_MODIFIER=(myenv)
         CONDA_PYTHON_EXE=/opt/apps/anaconda3/bin/python
               CONDA_ROOT=/opt/apps/anaconda3
              CONDA_SHLVL=2
           CURL_CA_BUNDLE=<not set>
               MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles
                     PATH=/opt/apps/anaconda3/bin:/home/f20220244/.conda/envs/myenv/bin:/home/f2
                          0220244/.vscode-server/cli/servers/Stable-38c31bc77e0dd6ae88a4e9cc9342
                          8cc27a56ba40/server/bin/remote-cli:/opt/apps/anaconda3/condabin:/usr/l
                          ocal/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/f20220244/.local/bin
                          :/home/f20220244/bin:/home/f20220244/.local/bin:/home/f20220244/bin:/h
                          ome/f20220244/.vscode-server/cli/servers/Stable-38c31bc77e0dd6ae88a4e9
                          cc93428cc27a56ba40/server/bin/remote-cli:/opt/apps/anaconda3/bin:/opt/
                          apps/anaconda3/condabin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/s
                          bin:/home/f20220244/.local/bin:/home/f20220244/bin:/home/f20220244/.lo
                          cal/bin:/home/f20220244/bin:/home/f20220244/.vscode-server/cli/servers
                          /Stable-38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/server/bin/remote-cli
                          :/opt/apps/anaconda3/bin:/opt/apps/anaconda3/condabin:/usr/local/bin:/
                          usr/bin:/usr/local/sbin:/usr/sbin:/home/f20220244/.local/bin:/home/f20
                          220244/bin:/home/f20220244/.local/bin:/home/f20220244/bin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

     active environment : myenv
    active env location : /home/f20220244/.conda/envs/myenv
            shell level : 2
       user config file : /home/f20220244/.condarc
 populated config files : /home/f20220244/.condarc
          conda version : 4.9.2
    conda-build version : 3.20.5
         python version : 3.8.5.final.0
       virtual packages : __glibc=2.17=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /opt/apps/anaconda3  (read only)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/apps/anaconda3/pkgs
                          /home/f20220244/.conda/pkgs
       envs directories : /home/f20220244/.conda/envs
                          /opt/apps/anaconda3/envs
               platform : linux-64
             user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.5 Linux/3.10.0-1062.el7.x86_64 centos/7.7.1908 glibc/2.17
                UID:GID : 1106:1108
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.

Upload did not complete.
  1. (myenv) [f20220244@masterdgx1 params]$ pip install scipy
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1135)'))': /simple/scipy/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1135)'))': /simple/scipy/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1135)'))': /simple/scipy/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1135)'))': /simple/scipy/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1135)'))': /simple/scipy/
Could not fetch URL https://pypi.org/simple/scipy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/scipy/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1135)'))) - skipping
ERROR: Could not find a version that satisfies the requirement scipy (from versions: none)
ERROR: No matching distribution found for scipy
  1. Trying to update conda throws a similar error as 1.
  2. Trying to update pip throws a similar error as 2.
  3. GPT suggested using: pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org --disable-pip-version-check --no-cache-dir --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --cert=/etc/ssl/certs/ca-certificates.crt
    This gave the requirements already satisifed output
  4. However, similarly trying to install scipy doesn’t work:
    (myenv) [f20220244@masterdgx1 params]$ pip install scipy --trusted-host pypi.org --trusted-host files.pythonhosted.org --cert=/etc/ssl/certs/ca-certificates.crt
ERROR: Could not find a version that satisfies the requirement scipy (from versions: none)
ERROR: No matching distribution found for scipy
  1. conda config --set ssl_verify False
    This did not work either.

What can I try next?

PS: I am even unable to create a new conda environment:

(base) [f20220244@masterdgx1 ~]$ conda create -n myenv python=3.9
Collecting package metadata (current_repodata.json): failed

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1079, in __call__
        return func(*args, **kwargs)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/cli/main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/cli/conda_argparse.py", line 83, in do_call
        return getattr(module, func_name)(args, parser)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/cli/main_create.py", line 41, in execute
        install(args, parser, 'create')
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/cli/install.py", line 261, in install
        unlink_link_transaction = solver.solve_for_transaction(
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 114, in solve_for_transaction
        unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 157, in solve_for_diff
        final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 262, in solve_final_state
        ssc = self._collect_all_metadata(ssc)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/common/io.py", line 88, in decorated
        return f(*args, **kwds)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 425, in _collect_all_metadata
        index, r = self._prepare(prepared_specs)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 1020, in _prepare
        reduced_index = get_reduced_index(self.prefix, self.channels,
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/index.py", line 276, in get_reduced_index
        new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs,
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 120, in query_all
        result = tuple(concat(executor.map(subdir_query, channel_urls)))
      File "/opt/apps/anaconda3/lib/python3.8/concurrent/futures/_base.py", line 611, in result_iterator
        yield fs.pop().result()
      File "/opt/apps/anaconda3/lib/python3.8/concurrent/futures/_base.py", line 439, in result
        return self.__get_result()
      File "/opt/apps/anaconda3/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
        raise self._exception
      File "/opt/apps/anaconda3/lib/python3.8/concurrent/futures/thread.py", line 57, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 112, in <lambda>
        subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query(
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 125, in query
        self.load()
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 189, in load
        _internal_state = self._load()
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 291, in _load
        _internal_state = self._process_raw_repodata_str(raw_repodata_str)
      File "/opt/apps/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 364, in _process_raw_repodata_str
        json_obj = json.loads(raw_repodata_str or '{}')
      File "/opt/apps/anaconda3/lib/python3.8/json/__init__.py", line 357, in loads
        return _default_decoder.decode(s)
      File "/opt/apps/anaconda3/lib/python3.8/json/decoder.py", line 337, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/opt/apps/anaconda3/lib/python3.8/json/decoder.py", line 353, in raw_decode
        obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 88 (char 87)

`$ /opt/apps/anaconda3/bin/conda create -n myenv python=3.9`

  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=/opt/apps/anaconda3/bin/conda
             CONDA_PREFIX=/opt/apps/anaconda3
           CONDA_PREFIX_1=/opt/apps/anaconda3/envs/pytorch
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=/opt/apps/anaconda3/bin/python
               CONDA_ROOT=/opt/apps/anaconda3
              CONDA_SHLVL=2
           CURL_CA_BUNDLE=<not set>
               MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles
                     PATH=/opt/apps/anaconda3/bin:/opt/apps/anaconda3/bin:/opt/apps/anaconda3/bi
                          n:/home/f20220244/.vscode-server/cli/servers/Stable-38c31bc77e0dd6ae88
                          a4e9cc93428cc27a56ba40/server/bin/remote-cli:/opt/apps/anaconda3/conda
                          bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/f20220244/
                          .local/bin:/home/f20220244/bin:/home/f20220244/.local/bin:/home/f20220
                          244/bin:/home/f20220244/.vscode-server/cli/servers/Stable-38c31bc77e0d
                          d6ae88a4e9cc93428cc27a56ba40/server/bin/remote-cli:/opt/apps/anaconda3
                          /bin:/opt/apps/anaconda3/condabin:/usr/local/bin:/usr/bin:/usr/local/s
                          bin:/usr/sbin:/home/f20220244/.local/bin:/home/f20220244/bin:/home/f20
                          220244/.local/bin:/home/f20220244/bin:/home/f20220244/.vscode-server/c
                          li/servers/Stable-38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40/server/bin/
                          remote-cli:/opt/apps/anaconda3/bin:/opt/apps/anaconda3/condabin:/usr/l
                          ocal/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/f20220244/.local/bin
                          :/home/f20220244/bin:/home/f20220244/.local/bin:/home/f20220244/bin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

     active environment : base
    active env location : /opt/apps/anaconda3
            shell level : 2
       user config file : /home/f20220244/.condarc
 populated config files : /home/f20220244/.condarc
          conda version : 4.9.2
    conda-build version : 3.20.5
         python version : 3.8.5.final.0
       virtual packages : __glibc=2.17=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /opt/apps/anaconda3  (read only)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/apps/anaconda3/pkgs
                          /home/f20220244/.conda/pkgs
       envs directories : /home/f20220244/.conda/envs
                          /opt/apps/anaconda3/envs
               platform : linux-64
             user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.5 Linux/3.10.0-1062.el7.x86_64 centos/7.7.1908 glibc/2.17
                UID:GID : 1106:1108
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.

Upload did not complete.

2

Answers


  1. Possible avenues would be to look into setting REQUESTS_CA_BUNDLE=<not set> environment variable to a valid cert that you know works in your environment. Also you can set the ssl_verify: key in your .condarc to that same cert.

    Since, you mentioned you are remoting into another box, I would configure these suggestions on the remote box. I am assuming this remote box has outbound internet access and is not behind a proxy.

    Login or Signup to reply.
  2. Please try below

    python -m pip install –trusted-host pypi.org –trusted-host pypi.python.org –trusted-host files.pythonhosted.org Package Name

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search