安裝Anaconda後不能安裝和建立環境

2021-10-24 01:49:09 字數 4492 閱讀 2783

主要問題:json.decoder.jsondecodeerror: expecting property name enclosed in double quotes: line 1 column 41 (char 40)

詳細問題:無論是建立環境還是安裝資料庫均會出現以下情況:

collecting package metadata (current_repodata.json): failed

traceback (most recent call last):

file "d:\programdata\anaconda3\lib\site-packages\conda\exceptions.py", line 1079, in __call__

return func(*args, **kwargs)

file "d:\programdata\anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main

exit_code = do_call(args, p)

file "d:\programdata\anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 82, in do_call

return getattr(module, func_name)(args, parser)

file "d:\programdata\anaconda3\lib\site-packages\conda\cli\main_install.py", line 20, in execute

install(args, parser, 'install')

file "d:\programdata\anaconda3\lib\site-packages\conda\cli\install.py", line 261, in install

unlink_link_transaction = solver.solve_for_transaction(

file "d:\programdata\anaconda3\lib\site-packages\conda\core\solve.py", line 114, in solve_for_transacti

unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,

file "d:\programdata\anaconda3\lib\site-packages\conda\core\solve.py", line 157, in solve_for_diff

final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,

file "d:\programdata\anaconda3\lib\site-packages\conda\core\solve.py", line 262, in solve_final_state

ssc = self._collect_all_metadata(ssc)

file "d:\programdata\anaconda3\lib\site-packages\conda\common\io.py", line 88, in decorated

return f(*args, **kwds)

file "d:\programdata\anaconda3\lib\site-packages\conda\core\solve.py", line 415, in _collect_all_metada

index, r = self._prepare(prepared_specs)

file "d:\programdata\anaconda3\lib\site-packages\conda\core\solve.py", line 1010, in _prepare

reduced_index = get_reduced_index(self.prefix, self.channels,

file "d:\programdata\anaconda3\lib\site-packages\conda\core\index.py", line 227, in get_reduced_index

new_records = subdirdata.query_all(spec, channels=channels, subdirs=subdirs,

file "d:\programdata\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 105, in query_all

result = tuple(concat(executor.map(subdir_query, channel_urls)))

file "d:\programdata\anaconda3\lib\concurrent\futures\_base.py", line 611, in result_iterator

yield fs.pop().result()

file "d:\programdata\anaconda3\lib\concurrent\futures\_base.py", line 432, in result

return self.__get_result()

file "d:\programdata\anaconda3\lib\concurrent\futures\_base.py", line 388, in __get_result

raise self._exception

file "d:\programdata\anaconda3\lib\concurrent\futures\thread.py", line 57, in run

result = self.fn(*self.args, **self.kwargs)

file "d:\programdata\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 97, in subdir_query = lambda url: tuple(subdirdata(channel(url), repodata_fn=repodata_fn).query(

file "d:\programdata\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 110, in query

self.load()

file "d:\programdata\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 174, in load

_internal_state = self._load()

file "d:\programdata\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 276, in _load

_internal_state = self._process_raw_repodata_str(raw_repodata_str)

file "d:\programdata\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 349, in _process_raw_r

json_obj = json.loads(raw_repodata_str or '{}')

file "d:\programdata\anaconda3\lib\json\__init__.py", line 357, in loads

return _default_decoder.decode(s)

file "d:\programdata\anaconda3\lib\json\decoder.py", line 337, in decode

obj, end = self.raw_decode(s, idx=_w(s, 0).end())

file "d:\programdata\anaconda3\lib\json\decoder.py", line 353, in raw_decode

obj, end = self.scan_once(s, idx)

json.decoder.jsondecodeerror: expecting property name enclosed in double quotes: line 1 column 41 (char 4

就我而言是因為多次安裝anaconda於不同路徑中,之前的anaconda檔案未刪除乾淨導致殘留的.condarc檔案,而每次安裝anaconda檔案都會自動生成乙個.condarc檔案。出現衝突,最好的辦法是將所有的.condarc檔案都刪除,然後隨便安裝乙個資料報,到時候會自動生成.condarc檔案。

使用以下命令檢查.condarc檔案的路徑,然後將其刪除。

conda config --show-sources

詳細的問題可以參考這個問答

希望大傢伙不要為這種事情煩心!

安裝anaconda後openssl衝突問題

在安裝anaconda後系統會存在兩種openssl,一種是anaconda安裝的,另一種是apt安裝的,導致在很多時候引起版本衝突問題 例如本人在從原始碼編譯moveit!時就遇到了這個問題 執行 which openssl 如果是使用系統中的openssl則會顯示 usr bin openssl...

安裝Anaconda後 python版本問題

命令語句建立乙個python3.6的虛擬環境 在anaconda prompt中輸入命令conda create n your env name python x.xyour env name是你的環境名 自己取乙個 x.x為版本號 然後進行漫長的等待 也有可能等了半天最後失敗,不過不要灰心 如果真...

安裝anaconda後終端出現base

安裝conda後取消命令行前出現的base,取消每次啟動自動啟用conda的基礎環境 方法一 每次在命令列通過conda deactivate退出base環境回到系統自帶的環境 方法二1,通過將auto activate base引數設定為false實現 conda config set auto ...