conda upgrade --all惹的祸,该怎么解决?

本想要安装scikit-surprise库,由于环境问题,就更新一下,谁知道差点酿成大祸,anaconda不灵了,无论什么语句都报错,jupyter notebook 不能用,navigator也打不开,万念俱灰了,导致我想要重装anaconda。但是在我不抛弃不放弃的精神下,解决了!
下面看一下错误,真长,头皮发麻!

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

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



Traceback (most recent call last):
  File "C:\Users\yzh\Anaconda3\lib\site-packages\conda\cli\main.py", line 171, in main
    activate.main()
  File "C:\Users\yzh\Anaconda3\lib\site-packages\conda\cli\activate.py", line 181, in main
    from ..install import symlink_conda
  File "C:\Users\yzh\Anaconda3\lib\site-packages\conda\install.py", line 37, in <module>
    from .core.package_cache import rm_fetched  # NOQA
  File "C:\Users\yzh\Anaconda3\lib\site-packages\conda\core\package_cache.py", line 9, in <module>
    from .path_actions import CacheUrlAction, ExtractPackageAction
  File "C:\Users\yzh\Anaconda3\lib\site-packages\conda\core\path_actions.py", line 33, in <module>
    from ..gateways.download import download
  File "C:\Users\yzh\Anaconda3\lib\site-packages\conda\gateways\download.py", line 10, in <module>
    from requests.exceptions import ConnectionError, HTTPError, InvalidSchema, SSLError
  File "C:\Users\yzh\Anaconda3\lib\site-packages\requests\__init__.py", line 52, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "C:\Users\yzh\Anaconda3\lib\site-packages\requests\packages\urllib3\contrib\pyopenssl.py", line 46, in <module>
    import OpenSSL.SSL
  File "C:\Users\yzh\Anaconda3\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "C:\Users\yzh\Anaconda3\lib\site-packages\OpenSSL\rand.py", line 12, in <module>
    from OpenSSL._util import (
  File "C:\Users\yzh\Anaconda3\lib\site-packages\OpenSSL\_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "C:\Users\yzh\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 141, in <module>
    Binding.init_static_locks()
  File "C:\Users\yzh\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 122, in init_static_locks
    cls._ensure_ffi_initialized()
  File "C:\Users\yzh\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 109, in _ensure_ffi_initialized
    cls.lib = build_conditional_library(lib, CONDITIONAL_NAMES)
  File "C:\Users\yzh\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 69, in build_conditional_library
    if not getattr(lib, condition):
AttributeError: cffi library '_openssl' has no function, constant or global variable named 'Cryptography_HAS_CMAC'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\yzh\Anaconda3\Scripts\conda-script.py", line 10, in <module>
    sys.exit(main())
  File "C:\Users\yzh\Anaconda3\lib\site-packages\conda\cli\main.py", line 179, in main
    return handle_exception(e)
  File "C:\Users\yzh\Anaconda3\lib\site-packages\conda\exceptions.py", line 634, in handle_exception
    print_unexpected_error_message(e)
  File "C:\Users\yzh\Anaconda3\lib\site-packages\conda\exceptions.py", line 596, in print_unexpected_error_message
    stderrlogger.info(get_main_info_str(get_info_dict()))
  File "C:\Users\yzh\Anaconda3\lib\site-packages\conda\cli\main_info.py", line 162, in get_info_dict
    from ..connection import user_agent
  File "C:\Users\yzh\Anaconda3\lib\site-packages\conda\connection.py", line 12, in <module>
    from requests import Session, __version__ as REQUESTS_VERSION
  File "C:\Users\yzh\Anaconda3\lib\site-packages\requests\__init__.py", line 52, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "C:\Users\yzh\Anaconda3\lib\site-packages\requests\packages\urllib3\contrib\pyopenssl.py", line 46, in <module>
    import OpenSSL.SSL
  File "C:\Users\yzh\Anaconda3\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "C:\Users\yzh\Anaconda3\lib\site-packages\OpenSSL\rand.py", line 12, in <module>
    from OpenSSL._util import (
  File "C:\Users\yzh\Anaconda3\lib\site-packages\OpenSSL\_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "C:\Users\yzh\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 141, in <module>
    Binding.init_static_locks()
  File "C:\Users\yzh\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 122, in init_static_locks
    cls._ensure_ffi_initialized()
  File "C:\Users\yzh\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 109, in _ensure_ffi_initialized
    cls.lib = build_conditional_library(lib, CONDITIONAL_NAMES)
  File "C:\Users\yzh\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 69, in build_conditional_library
    if not getattr(lib, condition):
AttributeError: cffi library '_openssl' has no function, constant or global variable named 'Cryptography_HAS_CMAC'

我也进github上找了错误,发现没有这样的症状,我只好死马当活马医了。找到最后一句错误,找到关键词‘_openssl’,于是,我便搜索这个关键词,找到了其对应的库名字。我想只要我更新一下这个,就能解决问题了,心里忐忑地尝试了一次,哎,就是这么神奇,居然好了,好了了。。。。。

pip install pyopenssl --upgrade


Collecting pyopenssl
  Downloading https://files.pythonhosted.org/packages/9e/de/f8342b68fa9e981d348039954657bdf681b2ab93de27443be51865ffa310/pyOpenSSL-19.1.0-py2.py3-none-any.whl (53kB)
    100% |████████████████████████████████| 61kB 102kB/s
Collecting six>=1.5.2 (from pyopenssl)
  Downloading https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Cache entry deserialization failed, entry ignored
Collecting cryptography>=2.8 (from pyopenssl)
  Downloading https://files.pythonhosted.org/packages/44/78/817db43993423dd4794d3828495df3425a445214180cfe22d0c81a04a155/cryptography-2.9.2-cp36-cp36m-win_amd64.whl (1.5MB)
    100% |████████████████████████████████| 1.5MB 19kB/s
Collecting cffi!=1.11.3,>=1.8 (from cryptography>=2.8->pyopenssl)
  Downloading https://files.pythonhosted.org/packages/94/49/8df433247344bf992ed319416a3c252f190dbfd7331cf7bb1432ca46980f/cffi-1.14.0-cp36-cp36m-win_amd64.whl (176kB)
    100% |████████████████████████████████| 184kB 19kB/s
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography>=2.8->pyopenssl)
  Downloading https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl (112kB)
    100% |████████████████████████████████| 112kB 23kB/s
Installing collected packages: six, pycparser, cffi, cryptography, pyopenssl
  Found existing installation: six 1.10.0
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling six-1.10.0:
      Successfully uninstalled six-1.10.0
  Found existing installation: pycparser 2.18
    DEPRECATION: Uninstalling a distutils installed project (pycparser) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling pycparser-2.18:
      Successfully uninstalled pycparser-2.18
  Found existing installation: cffi 1.10.0
    Uninstalling cffi-1.10.0:
      Successfully uninstalled cffi-1.10.0
  Found existing installation: cryptography 2.9
    Uninstalling cryptography-2.9:
      Successfully uninstalled cryptography-2.9
  Found existing installation: pyOpenSSL 17.0.0
    Uninstalling pyOpenSSL-17.0.0:
      Successfully uninstalled pyOpenSSL-17.0.0
Successfully installed cffi-1.14.0 cryptography-2.9.2 pycparser-2.20 pyopenssl-19.1.0 six-1.15.0

这下,我的anaconda又能使用了

你可能感兴趣的:(工具安装,anaconda)