conda相關命令報錯

2021-10-21 15:43:02 字數 2922 閱讀 4800

這裡說的報錯不是某乙個命令報錯,而是所有與conda有關的命令全部都報錯,anaconda prompt報錯內容類似,具體內容如下:

traceback (most recent call last):

file "c:\anaconda3\scripts\conda-script.py", line 10, in sys.exit(main())

file "c:\anaconda3\lib\site-packages\conda\cli\main.py", line 182, in main

return conda_exception_handler(_main, *args)

file "c:\anaconda3\lib\site-packages\conda\exceptions.py", line 644, in conda_exception_handler

return handle_exception(e)

file "c:\anaconda3\lib\site-packages\conda\exceptions.py", line 634, in handle_exception

print_unexpected_error_message(e)

file "c:\anaconda3\lib\site-packages\conda\exceptions.py", line 579, in print_unexpected_error_message

from .base.context import context

file "c:\anaconda3\lib\site-packages\conda\common\configuration.py", line 727, in __init__

self._set_search_path(search_path)

file "c:\anaconda3\lib\site-packages\conda\common\configuration.py", line 745, in _set_search_path

self._set_raw_data(load_file_configs(search_path))

file "c:\anaconda3\lib\site-packages\conda\common\configuration.py", line 369, in load_file_configs

raw_data = odict(kv for kv in chain.from_iterable(load_paths))

file "c:\anaconda3\lib\site-packages\conda\common\configuration.py", line 369, in raw_data = odict(kv for kv in chain.from_iterable(load_paths))

file "c:\anaconda3\lib\site-packages\conda\common\configuration.py", line 344, in _file_yaml_loader

yield fullpath, yamlrawparameter.make_raw_parameters_from_file(fullpath)

file "c:\anaconda3\lib\site-packages\conda\common\configuration.py", line 332, in make_raw_parameters_from_file

ruamel_yaml = yaml_load(fh)

file "c:\anaconda3\lib\site-packages\conda\common\yaml.py", line 26, in yaml_load

return yaml.load(string, loader=yaml.roundtriploader, version="1.2")

file "c:\anaconda3\lib\site-packages\ruamel_yaml\main.py", line 73, in load

loader = loader(stream, version, preserve_quotes=preserve_quotes)

file "c:\anaconda3\lib\site-packages\ruamel_yaml\loader.py", line 56, in __init__

reader.__init__(self, stream)

file "c:\anaconda3\lib\site-packages\ruamel_yaml\reader.py", line 98, in __init__

self.determine_encoding()

file "c:\anaconda3\lib\site-packages\ruamel_yaml\reader.py", line 149, in determine_encoding

self.update(1)

file "c:\anaconda3\lib\site-packages\ruamel_yaml\reader.py", line 189, in update

self.check_printable(data)

file "c:\anaconda3\lib\site-packages\ruamel_yaml\reader.py", line 160, in check_printable

'unicode', "special characters are not allowed")

ruamel_yaml.reader.readererror: unacceptable character #x0000: special characters are not allowed

in "c:\users\admin\.condarc", position 0

刪除c:\users\admin(你的使用者名稱)\.condarc

問題解決,原理未知。

conda命令使用

前提是安裝了anconda 1 檢視當前系統下的虛擬環境 在終端中輸入 conda info e 2 切換虛擬環境linux mac下使用 source activate 虛擬環境的名字 3 退出虛擬環境 deacitvate 虛擬環境的名字 4 移除虛擬環境的 conda remove n 虛擬環...

conda基礎命令

1 首先在所在系統中安裝anaconda。可以開啟命令列輸入conda v檢驗是否安裝以及當前conda的版本。2 conda常用的命令。1 conda list 檢視安裝了哪些包。2 conda env list 或 conda info e 檢視當前存在哪些虛擬環境 3 conda update...

Conda命令指標

檢視當前環境下已安裝的包 conda list 檢視某個指定環境的已安裝包 conda list n tensorflow 查詢package資訊 conda search numpy 安裝package conda install n tensorflow numpy 如果不用 n指定環境名稱,則...