2016-11-29 95 views
0

我在AWS EC2上啓動了一個使用ubuntu作爲AMI的實例。使用conda更新軟件包時出錯

然後我運行一個腳本來安裝jupyter筆記本,並能夠通過IP地址和特定端口訪問它。 我寫的代碼是這樣的一個:

sudo apt-get install git 

git clone https://gist.github.com/rashmibanthia/5a1e4d7e313d6832f2ff nb 

. nb/jupyter_notebook_ec2.sh 

cd;mkdir notebook;cd notebook 

tmux new -s nb 

jupyter notebook --certfile=~/certs/mycert.pem --keyfile ~/certs/mycert.key 

現在我在筆記本上。這是我的問題。當我嘗試導入一些包和類時,出現錯誤。例如這條線:

from sklearn.gaussian_process import GaussianProcessRegressor 

我得到這個:

ImportError Traceback (most recent call last) in() ----> 1 from sklearn.gaussian_process import GaussianProcessRegressor

ImportError: cannot import name 'GaussianProcessRegressor'

所以我嘗試更新scikit學習包與暢達更新暢達scikit學習,但我有另一個錯誤:

Fetching package metadata ...An unexpected error has occurred. Please consider posting the following information to the conda GitHub issue tracker at:

https://github.com/conda/conda/issues 

當前暢達安裝:

  platform : linux-64 
     conda version : 4.2.13 
    conda is private : False 
    conda-env version : 4.2.13 
conda-build version : 1.18.2 
    python version : 3.5.2.final.0 
    requests version : 2.12.1 
    root environment : /home/ubuntu/anaconda3 (writable) 
default environment : /home/ubuntu/anaconda3 
    envs directories : /home/ubuntu/anaconda3/envs 
     package cache : /home/ubuntu/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/ubuntu/anaconda3/bin/conda update scikit-learn 

Traceback (most recent call last): 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/conda/exceptions.py", line 479, in conda_exception_handler 
    return_value = func(*args, **kwargs) 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/conda/cli/main.py", line 145, in _main 
    exit_code = args.func(args, p) 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/conda/cli/main_update.py", line 65, in execute 
    install(args, parser, 'update') 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/conda/cli/install.py", line 238, in install 
    prefix=prefix) 
    File "/home/ubuntu/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/ubuntu/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 300, in fetch_index 
    repodatas = [(u, f.result()) for u, f in zip(urls, futures)] 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 300, in <listcomp> 
    repodatas = [(u, f.result()) for u, f in zip(urls, futures)] 
    File "/home/ubuntu/anaconda3/lib/python3.5/concurrent/futures/_base.py", line 405, in result 
    return self.__get_result() 
    File "/home/ubuntu/anaconda3/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result 
    raise self._exception 
    File "/home/ubuntu/anaconda3/lib/python3.5/concurrent/futures/thread.py", line 55, in run 
    result = self.fn(*self.args, **self.kwargs) 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 75, in func 
    res = f(*args, **kwargs) 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/conda/fetch.py", line 117, in fetch_repodata 
    timeout=(6.1, 60)) 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/requests/sessions.py", line 501, in get 
    return self.request('GET', url, **kwargs) 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/requests/sessions.py", line 488, in request 
    resp = self.send(prep, **send_kwargs) 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/requests/sessions.py", line 609, in send 
    r = adapter.send(request, **kwargs) 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/requests/adapters.py", line 423, in send 
    timeout=timeout 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 594, in urlopen 
    chunked=chunked) 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 350, in _make_request 
    self._validate_conn(conn) 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 835, in _validate_conn 
    conn.connect() 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 330, in connect 
    cert = self.sock.getpeercert() 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 324, in getpeercert 
    'subjectAltName': get_subj_alt_name(x509) 
    File "/home/ubuntu/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 171, in get_subj_alt_name 
    ext = cert.extensions.get_extension_for_class(
AttributeError: 'Extensions' object has no attribute 'get_extension_for_class' 

回答