Anaconda中的“字节索引必须是整数或切片,而不是str”错误

时间:2018-11-01 20:18:28

标签: python python-3.x anaconda runtime-error

我正在尝试在Windows 10上运行anaconda导航器。当我单击anaconda提示符时,它显示了一些错误;当我尝试运行anaconda导航器时,它显示了另一个错误,将无法运行。所以我将其卸载了3次,并且也卸载了python,但错误仍然存​​在。我吓坏了。 在第二和第三次尝试安装anaconda的过程中,“添加到路径”部分的安装对我完全没有显示。 我的python是3.6 你能帮我吗 ?

  

Navigator错误Navigator启动时发生意外错误

     

报告,请在anaconda问题跟踪器中报告此问题

     

主要错误字节索引必须是整数或切片,而不是str追溯    TypeError:字节索引必须是整数或切片,而不是str

我已经搜索了stackoverflow,但是找不到合适的解决方案 我的anaconda提示错误:

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main.py", line 110, in main
        from ..activate import main as activator_main
      File "C:\ProgramData\Anaconda3\lib\site-packages\conda\activate.py", line 12, in <module>
        context.__init__()  # oOn import, context does not include SEARCH_PATH. This line fixes that.
      File "C:\ProgramData\Anaconda3\lib\site-packages\conda\base\context.py", line 234, in __init__
        argparse_args=argparse_args)
      File "C:\ProgramData\Anaconda3\lib\site-packages\conda\common\configuration.py", line 723, in __init__
        self._set_search_path(search_path)
      File "C:\ProgramData\Anaconda3\lib\site-packages\conda\common\configuration.py", line 729, in _set_search_path
        self._set_raw_data(load_file_configs(search_path))
      File "C:\ProgramData\Anaconda3\lib\site-packages\conda\common\configuration.py", line 371, in load_file_configs
        raw_data = odict(kv for kv in chain.from_iterable(load_paths))
      File "C:\ProgramData\Anaconda3\lib\site-packages\conda\common\configuration.py", line 371, in <genexpr>
        raw_data = odict(kv for kv in chain.from_iterable(load_paths))
      File "C:\ProgramData\Anaconda3\lib\site-packages\conda\common\configuration.py", line 346, in _file_yaml_loader
        yield fullpath, YamlRawParameter.make_raw_parameters_from_file(fullpath)
      File "C:\ProgramData\Anaconda3\lib\site-packages\conda\common\configuration.py", line 334, in make_raw_parameters_from_file
        ruamel_yaml = yaml_load(fh)
      File "C:\ProgramData\Anaconda3\lib\site-packages\conda\common\serialize.py", line 54, in yaml_load
        return yaml.load(string, Loader=yaml.RoundTripLoader, version="1.2")
      File "C:\ProgramData\Anaconda3\lib\site-packages\ruamel_yaml\main.py", line 637, in load
        loader = Loader(stream, version, preserve_quotes=preserve_quotes)
      File "C:\ProgramData\Anaconda3\lib\site-packages\ruamel_yaml\loader.py", line 59, in __init__
        Reader.__init__(self, stream, loader=self)
      File "C:\ProgramData\Anaconda3\lib\site-packages\ruamel_yaml\reader.py", line 80, in __init__
        self.stream = stream  # type: Any  # as .read is called
      File "C:\ProgramData\Anaconda3\lib\site-packages\ruamel_yaml\reader.py", line 125, in stream
        self.determine_encoding()
      File "C:\ProgramData\Anaconda3\lib\site-packages\ruamel_yaml\reader.py", line 180, in determine_encoding
        self.update(1)
      File "C:\ProgramData\Anaconda3\lib\site-packages\ruamel_yaml\reader.py", line 241, in update
        self.check_printable(data)
      File "C:\ProgramData\Anaconda3\lib\site-packages\ruamel_yaml\reader.py", line 208, in check_printable
        'unicode', "special characters are not allowed")
    ruamel_yaml.reader.ReaderError: unacceptable character #x0000: special characters are not allowed
      in "C:\Users\Mohammad\.condarc", position 0

`$ C:\ProgramData\Anaconda3\Scripts\conda shell.cmd.exe activate activate C:\ProgramData\Anaconda3`

  environment variables:
                 CIO_TEST=<not set>
               CONDA_ROOT=C:\ProgramData\Anaconda3
                 HOMEPATH=\Users\Mohammad
                     PATH=C:\ProgramData\Anaconda3\Library\bin;C:\Program Files (x86)\Common
                          Files\Oracle\Java\javapath;C:\Program Files\Microsoft MPI\Bin\;C:\Wind
                          ows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\W
                          indowsPowerShell\v1.0\;C:\Program Files\dotnet\;C:\Program
                          Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program
                          Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files\Microsoft VS
                          Code\bin;C:\Program Files (x86)\Microsoft SQL Server\Client
                          SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL
                          Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL
                          Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\T
                          ools\Binn\ManagementStudio\;C:\Users\Mohammad\AppData\Local\Programs\P
                          ython\Python36-32\Scripts\;C:\Users\Mohammad\AppData\Local\Programs\Py
                          thon\Python36-32\;C:\Ruby25-x64\bin;C:\Program Files\Microsoft VS
                          Code\bin;C:\Users\Mohammad\AppData\Roaming\npm
             PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\Windows
                          PowerShell\v1.0\Modules
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>
    VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\

     active environment : None
       user config file : C:\Users\Mohammad\.condarc
 populated config files :
          conda version : 4.4.10
    conda-build version : 3.4.1
         python version : 3.6.4.final.0
       base environment : C:\ProgramData\Anaconda3  (read only)
           channel URLs : https://repo.continuum.io/pkgs/main/win-64
                          https://repo.continuum.io/pkgs/main/noarch
                          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
          package cache : C:\ProgramData\Anaconda3\pkgs
                          C:\Users\Mohammad\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\Mohammad\AppData\Local\conda\conda\envs
                          C:\ProgramData\Anaconda3\envs
                          C:\Users\Mohammad\.conda\envs
               platform : win-64
             user-agent : conda/4.4.10 requests/2.18.4 CPython/3.6.4 Windows/10 Windows/10.0.10586
          administrator : False
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.
If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?
[y/N]:

1 个答案:

答案 0 :(得分:3)

相关的错误消息位于此处

ruamel_yaml.reader.ReaderError: unacceptable character #x0000: special characters are not allowed
in "C:\Users\Mohammad\.condarc", position 0

删除该文件C:\Users\Mohammad\.condarc应该可以解决问题。