在anaconda3环境下创建新的python3环境,但总是会出现以下错误,请大神们寻求帮助????
(base) yz@yz-PC:~$ conda create --name python3 python=3.7
Solving environment: failed
WARNING conda.exceptions:print_unexpected_error_report(949): KeyError('pkgs_dirs')
Traceback (most recent call last):
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/gateways/connection/session.py", line 50, in __call__
return cls._thread_local.session
AttributeError: '_thread._local' object has no attribute 'session'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 819, in __call__
return func(*args, **kwargs)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/cli/conda_argparse.py", line 77, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/cli/main_create.py", line 11, in execute
install(args, parser, 'create')
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/cli/install.py", line 235, in install
force_reinstall=context.force,
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 518, in solve_for_transaction
force_remove, force_reinstall)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 451, in solve_for_diff
final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 180, in solve_final_state
index, r = self._prepare(prepared_specs)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 592, in _prepare
self.subdirs, prepared_specs)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 215, in get_reduced_index
new_records = query_all(spec)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 184, in query_all
return tuple(concat(future.result() for future in as_completed(futures)))
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 95, in query
self.load()
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 149, in load
_internal_state = self._load()
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 227, in _load
mod_etag_headers.get('_mod'))
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 418, in fetch_repodata_remote_request
session = CondaSession()
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/gateways/connection/session.py", line 52, in __call__
session = cls._thread_local.session = super(CondaSessionType, cls).__call__()
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/gateways/connection/session.py", line 85, in __init__
self.headers['User-Agent'] = context.user_agent
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/base/context.py", line 623, in user_agent
return _get_user_agent(self.platform)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/_vendor/auxlib/decorators.py", line 56, in _memoized_func
result = func(*args, **kwargs)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/base/context.py", line 920, in _get_user_agent
from .._vendor.distro import linux_distribution
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/_vendor/distro.py", line 1084, in
_distro = LinuxDistribution()
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/_vendor/distro.py", line 600, in __init__
if include_lsb else {}
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/_vendor/distro.py", line 943, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 947, in print_unexpected_error_report
message_builder.append(get_main_info_str(error_report['conda_info']))
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/cli/main_info.py", line 243, in get_main_info_str
info_dict['_' + key] = ('\n' + 26 * ' ').join(info_dict[key])
KeyError: 'pkgs_dirs'
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/gateways/connection/session.py", line 50, in __call__
return cls._thread_local.session
AttributeError: '_thread._local' object has no attribute 'session'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 819, in __call__
return func(*args, **kwargs)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/cli/conda_argparse.py", line 77, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/cli/main_create.py", line 11, in execute
install(args, parser, 'create')
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/cli/install.py", line 235, in install
force_reinstall=context.force,
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 518, in solve_for_transaction
force_remove, force_reinstall)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 451, in solve_for_diff
final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 180, in solve_final_state
index, r = self._prepare(prepared_specs)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 592, in _prepare
self.subdirs, prepared_specs)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 215, in get_reduced_index
new_records = query_all(spec)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 184, in query_all
return tuple(concat(future.result() for future in as_completed(futures)))
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 95, in query
self.load()
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 149, in load
_internal_state = self._load()
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 227, in _load
mod_etag_headers.get('_mod'))
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/core/subdir_data.py", line 418, in fetch_repodata_remote_request
session = CondaSession()
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/gateways/connection/session.py", line 52, in __call__
session = cls._thread_local.session = super(CondaSessionType, cls).__call__()
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/gateways/connection/session.py", line 85, in __init__
self.headers['User-Agent'] = context.user_agent
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/base/context.py", line 623, in user_agent
return _get_user_agent(self.platform)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/_vendor/auxlib/decorators.py", line 56, in _memoized_func
result = func(*args, **kwargs)
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/base/context.py", line 920, in _get_user_agent
from .._vendor.distro import linux_distribution
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/_vendor/distro.py", line 1084, in
_distro = LinuxDistribution()
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/_vendor/distro.py", line 600, in __init__
if include_lsb else {}
File "/home/yz/anaconda3/lib/python3.7/site-packages/conda/_vendor/distro.py", line 943, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.
`$ /home/yz/anaconda3/bin/conda create --name python3 python=3.7`
environment variables:
conda info could not be constructed.
KeyError('pkgs_dirs')
An unexpected error has occurred. Conda has prepared the above report.
(base) yz@yz-PC:~$
解决办法:升级pip就可以了