Anaconda Prompt无法启动_NamespacePath

时间:2017-04-18 14:37:38

标签: python anaconda

我有一个奇怪的错误,我无法找到解决方案。每次我启动Anaconda Prompt(运行Windows 10)时,我都会在底部收到以下错误。即使我尝试使用conda,我也会得到相同的错误(在安装信息之后)。我尝试卸载并重新安装Anaconda甚至Python。直到今天我都没有遇到过Anaconda的问题。

谢谢, 鲍勃

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\Scripts\conda-script.py", line 5, in <module>
    sys.exit(conda.cli.main())
  File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main.py", line 151, in main
    activate.main()
  File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\activate.py", line 118, in main
    from conda.utils import shells
  File "C:\ProgramData\Anaconda3\lib\site-packages\conda\utils.py", line 13, in <module>
    from .gateways.disk.read import compute_md5sum
  File "C:\ProgramData\Anaconda3\lib\site-packages\conda\gateways\disk\read.py", line 22, in <module>
    from ...models.channel import Channel
  File "C:\ProgramData\Anaconda3\lib\site-packages\conda\models\channel.py", line 9, in <module>
    from ..base.context import context
  File "C:\ProgramData\Anaconda3\lib\site-packages\conda\base\context.py", line 19, in <module>
    from .._vendor.auxlib.path import expand
  File "C:\ProgramData\Anaconda3\lib\site-packages\conda\_vendor\auxlib\path.py", line 8, in <module>
    import pkg_resources
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 646, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 616, in _load_backward_compatible
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2985, in <module>
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2971, in _call_aside
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 3013, in _initialize_master_working_set
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2544, in activate
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2118, in declare_namespace
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2058, in _handle_ns
  File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2087, in _rebuild_mod_path
AttributeError: '_NamespacePath' object has no attribute 'sort'

目前的conda安装:

           platform : win-64
      conda version : 4.3.14
   conda is private : False
  conda-env version : 4.3.14
conda-build version : not installed
     python version : 3.6.0.final.0
   requests version : 2.12.4
   root environment : C:\ProgramData\Anaconda3  (read only)
default environment : C:\ProgramData\Anaconda3
   envs directories : C:\ProgramData\Anaconda3\envs
                      C:\Users\auser\AppData\Local\conda\conda\envs
                      C:\Users\auser\.conda\envs
      package cache : C:\ProgramData\Anaconda3\pkgs
                      C:\Users\auser\AppData\Local\conda\conda\pkgs
       channel URLs : https://repo.continuum.io/pkgs/free/win-64
                      https://repo.continuum.io/pkgs/free/noarch
                      https://repo.continuum.io/pkgs/r/win-64
                      https://repo.continuum.io/pkgs/r/noarch
                      https://repo.continuum.io/pkgs/pro/win-64
                      https://repo.continuum.io/pkgs/pro/noarch
                      https://repo.continuum.io/pkgs/msys2/win-64
                      https://repo.continuum.io/pkgs/msys2/noarch
        config file : None
       offline mode : False
         user-agent : conda/4.3.14 requests/2.12.4 CPython/3.6.0 Windows/10 Windows/10.0.15063

1 个答案:

答案 0 :(得分:0)

我已经通过克隆pip和setuptools源代码解决了它。然后,使用

安装
python setup.py install

通过Anaconda提示。 注意:在命令setuptools-> pip中安装软件包。使用setuptools在安装之前先运行python bootstrap.py