Can not create a new conda environment/clean conda #4224

Open
vovanhuy opened this Issue Jan 8, 2017 · 3 comments

Projects

None yet

2 participants

@vovanhuy
vovanhuy commented Jan 8, 2017 edited

I have just installed anaconda 4.2.0 on my system Ubuntu 16.04. As the default version of python is 3.5.2, i tried to create a new environment for Python 2.7 but it was impossible. I then tried to clean conda but this issue occured:

Current conda install:

           platform : linux-64
      conda version : 4.2.9
   conda is private : False
  conda-env version : 4.2.9
conda-build version : 2.0.2
     python version : 3.5.2.final.0
   requests version : 2.11.1
   root environment : /home/huy/anaconda3  (writable)
default environment : /home/huy/anaconda3
   envs directories : /home/huy/anaconda3/envs
      package cache : /home/huy/anaconda3/pkgs
       channel URLs : https://repo.continuum.io/pkgs/free/linux-64/
                      https://repo.continuum.io/pkgs/free/noarch/
                      https://repo.continuum.io/pkgs/pro/linux-64/
                      https://repo.continuum.io/pkgs/pro/noarch/
        config file : None
       offline mode : False

$ /home/huy/anaconda3/bin/conda install anaconda-clean

Traceback (most recent call last):
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 112, in fetch_repodata
    timeout=(3.05, 60))
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/sessions.py", line 488, in get
    return self.request('GET', url, **kwargs)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/adapters.py", line 390, in send
    conn = self.get_connection(request.url, proxies)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/adapters.py", line 290, in get_connection
    proxy_manager = self.proxy_manager_for(proxy)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/adapters.py", line 184, in proxy_manager_for
    **proxy_kwargs
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/adapters.py", line 43, in SOCKSProxyManager
    raise InvalidSchema("Missing dependencies for SOCKS support.")
requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 287, in fetch_index
    repodatas = [(u, f.result()) for u, f in zip(urls, futures)]
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 287, in <listcomp>
    repodatas = [(u, f.result()) for u, f in zip(urls, futures)]
  File "/home/huy/anaconda3/lib/python3.5/concurrent/futures/_base.py", line 405, in result
    return self.__get_result()
  File "/home/huy/anaconda3/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result
    raise self._exception
  File "/home/huy/anaconda3/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 70, in func
    res = f(*args, **kwargs)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 137, in fetch_repodata
    .format(url, filename, e))
conda.exceptions.CondaRuntimeError: Runtime error: Invalid index file: https://repo.continuum.io/pkgs/free/linux-64/repodata.json.bz2: Missing dependencies for SOCKS support.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 112, in fetch_repodata
    timeout=(3.05, 60))
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/sessions.py", line 488, in get
    return self.request('GET', url, **kwargs)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/adapters.py", line 390, in send
    conn = self.get_connection(request.url, proxies)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/adapters.py", line 290, in get_connection
    proxy_manager = self.proxy_manager_for(proxy)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/adapters.py", line 184, in proxy_manager_for
    **proxy_kwargs
  File "/home/huy/anaconda3/lib/python3.5/site-packages/requests/adapters.py", line 43, in SOCKSProxyManager
    raise InvalidSchema("Missing dependencies for SOCKS support.")
requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/exceptions.py", line 473, in conda_exception_handler
    return_value = func(*args, **kwargs)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/cli/main.py", line 144, in _main
    exit_code = args.func(args, p)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/cli/main_install.py", line 80, in execute
    install(args, parser, 'install')
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/cli/install.py", line 238, in install
    prefix=prefix)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/api.py", line 24, in get_index
    index = fetch_index(channel_urls, use_cache=use_cache, unknown=unknown)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 293, in fetch_index
    for url in urls]
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 293, in <listcomp>
    for url in urls]
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 70, in func
    res = f(*args, **kwargs)
  File "/home/huy/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 137, in fetch_repodata
    .format(url, filename, e))
conda.exceptions.CondaRuntimeError: Runtime error: Invalid index file: https://repo.continuum.io/pkgs/free/linux-64/repodata.json.bz2: Missing dependencies for SOCKS support.

What can I do to repair it?

@vovanhuy vovanhuy closed this Jan 9, 2017
@vovanhuy vovanhuy reopened this Jan 9, 2017
@vovanhuy vovanhuy changed the title from Can not create a new conda environment to Can not create a new conda environment/ clean conda Jan 9, 2017
@vovanhuy vovanhuy changed the title from Can not create a new conda environment/ clean conda to Can not create a new conda environment/clean conda Jan 9, 2017
@nehaljwani
Contributor

@vovanhuy Could you please share the output for:
env | grep -i proxy
I suspect that you are behind a (corporate?) http(s?)-proxy, but you have accidentally also added it as a socks proxy in the network configuration in Ubuntu, which also creates the environment variable:
SOCKS_PROXY

@vovanhuy
vovanhuy commented Jan 9, 2017

Yes, you are right. I added proxy for both http(s) and socks. However, when I tried to delete anaconda 4.2.0 and use 4.1.1, everything is ok.

@nehaljwani
Contributor

Perhaps conda should provide a better error message/resolution. I had mentioned a fix/workaround for this in #3838. Conda doesn't mention whether it officially supports SOCKS proxy at http://conda.pydata.org/docs/config.html#configure-conda-for-use-behind-a-proxy-server-proxy-servers . Perhaps the docs should explicitly mention that? Or, if it does support, then perhaps mention the order in which different types of proxies are checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment