Stackoverflow/Python

UnavailableInvalidChannel: The channel is not accessible or is invalid

The Neo 2022. 3. 6. 00:00

에러 내용

conda create --name 가상환경명 python=버전

가상환경 생성 중 아래와 같은 에러 발생

 

conda create --name test python=3.8.0
Collecting package metadata (current_repodata.json): failed

UnavailableInvalidChannel: The channel is not accessible or is invalid.
  channel name: simple
  channel url: https://pypi.python.org/simple
  error code: 404

You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state,
and use `conda config --show-sources` to view config file locations

Repository를 https://pypi.python.org/simple로 바꾼적이 있는데 이것 때문에 에러가 발생한 듯 싶다.

 

콘다 상태확인

conda info

 

 

     active environment : base
    active env location : /Users/stevejang/opt/anaconda3
            shell level : 1
       user config file : /Users/stevejang/.condarc
 populated config files : /Users/stevejang/.condarc
          conda version : 4.11.0
    conda-build version : 3.21.7
         python version : 3.7.11.final.0
       virtual packages : __osx=10.16=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/stevejang/opt/anaconda3  (writable)
      conda av data dir : /Users/stevejang/opt/anaconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://pypi.python.org/simple/osx-64
                          https://pypi.python.org/simple/noarch
                          https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/stevejang/opt/anaconda3/pkgs
                          /Users/stevejang/.conda/pkgs
       envs directories : /Users/stevejang/opt/anaconda3/envs
                          /Users/stevejang/.conda/envs
               platform : osx-64
             user-agent : conda/4.11.0 requests/2.27.1 CPython/3.7.11 Darwin/21.3.0 OSX/10.16
                UID:GID : 501:20
             netrc file : None
           offline mode : False

 

conda config --show-sources

==> /Users/stevejang/.condarc <==
ssl_verify: True
channels:
  - https://pypi.python.org/simple
  - defaults

 

해결책

conda config --remove로 채널을 삭제하라는 내용

 

conda config --remove channels https://pypi.python.org/simple로 채널 삭제, 디폴트만 남겨 두었다.

(base) Steveui-MacBook-Pro:/ stevejang$ conda config --remove channels https://pypi.python.org/simple
(base) Steveui-MacBook-Pro:/ stevejang$ conda config --show-sources
==> /Users/stevejang/.condarc <==
ssl_verify: True
channels:
  - defaults

 

문제 해결 완료

conda create --name test python=3.8
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/stevejang/opt/anaconda3/envs/test

  added / updated specs:
    - python=3.8


The following NEW packages will be INSTALLED:

  ca-certificates    pkgs/main/osx-64::ca-certificates-2022.2.1-hecd8cb5_0
  certifi            pkgs/main/osx-64::certifi-2021.10.8-py38hecd8cb5_2
  libcxx             pkgs/main/osx-64::libcxx-12.0.0-h2f01273_0
  libffi             pkgs/main/osx-64::libffi-3.3-hb1e8313_2
  ncurses            pkgs/main/osx-64::ncurses-6.3-hca72f7f_2
  openssl            pkgs/main/osx-64::openssl-1.1.1m-hca72f7f_0
  pip                pkgs/main/osx-64::pip-21.2.4-py38hecd8cb5_0
  python             pkgs/main/osx-64::python-3.8.12-h88f2d9e_0
  readline           pkgs/main/osx-64::readline-8.1.2-hca72f7f_1
  setuptools         pkgs/main/osx-64::setuptools-58.0.4-py38hecd8cb5_0
  sqlite             pkgs/main/osx-64::sqlite-3.37.2-h707629a_0
  tk                 pkgs/main/osx-64::tk-8.6.11-h7bc2e8c_0
  wheel              pkgs/main/noarch::wheel-0.37.1-pyhd3eb1b0_0
  xz                 pkgs/main/osx-64::xz-5.2.5-h1de35cc_0
  zlib               pkgs/main/osx-64::zlib-1.2.11-h4dc903c_4


Proceed ([y]/n)?

 

참고자료

[1] https://github.com/conda/conda/issues/9473

반응형