完整报错如下:
(base) ➜ /paddle conda create -n abcnet python=3.10 -y
Collecting package metadata (current_repodata.json): failed
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/gateways/connection/session.py", line 75, 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 "/paddle/anaconda3/lib/python3.11/site-packages/conda/exception_handler.py", line 17, in __call__
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/cli/main.py", line 64, in main_subshell
exit_code = do_call(args, parser)
^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/cli/conda_argparse.py", line 167, in do_call
result = getattr(module, func_name)(args, parser)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/notices/core.py", line 124, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/cli/main_create.py", line 50, in execute
install(args, parser, "create")
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/cli/install.py", line 316, in install
unlink_link_transaction = solver.solve_for_transaction(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/core/solve.py", line 154, in solve_for_transaction
unlink_precs, link_precs = self.solve_for_diff(
^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/core/solve.py", line 215, in solve_for_diff
final_precs = self.solve_final_state(
^^^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/core/solve.py", line 358, in solve_final_state
ssc = self._collect_all_metadata(ssc)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/common/io.py", line 84, in decorated
return f(*args, **kwds)
^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/core/solve.py", line 572, in _collect_all_metadata
index, r = self._prepare(prepared_specs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/core/solve.py", line 1286, in _prepare
reduced_index = get_reduced_index(
^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/core/index.py", line 287, in get_reduced_index
new_records = SubdirData.query_all(
^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/core/subdir_data.py", line 158, in query_all
result = tuple(
^^^^^^
File "/paddle/anaconda3/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
yield _result_or_cancel(fs.pop())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
return fut.result(timeout)
^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/paddle/anaconda3/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/core/subdir_data.py", line 143, in subdir_query
return tuple(
^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/core/subdir_data.py", line 165, in query
self.load()
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/core/subdir_data.py", line 265, in load
_internal_state = self._load()
^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/core/subdir_data.py", line 322, in _load
repodata, state = fetcher.fetch_latest_parsed()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/gateways/repodata/__init__.py", line 758, in fetch_latest_parsed
parsed, state = self.fetch_latest()
^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/gateways/repodata/__init__.py", line 880, in fetch_latest
raw_repodata = repo.repodata(cache.state) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/gateways/repodata/__init__.py", line 131, in repodata
session = CondaSession()
^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/gateways/connection/session.py", line 77, in __call__
session = cls._thread_local.session = super().__call__()
^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/gateways/connection/session.py", line 114, in __init__
self.headers["User-Agent"] = context.user_agent
^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/auxlib/decorators.py", line 267, in new_fget
cache[inner_attname] = func(self)
^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/anaconda_anon_usage/patch.py", line 15, in _new_user_agent
result = ctx._old_user_agent
^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/auxlib/decorators.py", line 267, in new_fget
cache[inner_attname] = func(self)
^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/base/context.py", line 965, in user_agent
builder.append("%s/%s" % self.os_distribution_name_version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/auxlib/decorators.py", line 267, in new_fget
cache[inner_attname] = func(self)
^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/base/context.py", line 1036, in os_distribution_name_version
from conda._vendor.distro import id, version
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/_vendor/distro.py", line 1080, in <module>
_distro = LinuxDistribution()
^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/_vendor/distro.py", line 595, in __init__
self._lsb_release_info = self._get_lsb_release_info() \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/paddle/anaconda3/lib/python3.11/site-packages/conda/_vendor/distro.py", line 939, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.
`$ /paddle/anaconda3/bin/conda create -n abcnet python=3.10 -y`
environment variables:
CIO_TEST=<not set>
CONDA_DEFAULT_ENV=base
CONDA_EXE=/paddle/anaconda3/bin/conda
CONDA_PREFIX=/paddle/anaconda3
CONDA_PROMPT_MODIFIER=(base)
CONDA_PYTHON_EXE=/paddle/anaconda3/bin/python
CONDA_ROOT=/paddle/anaconda3
CONDA_SHLVL=1
CURL_CA_BUNDLE=<not set>
GOPATH=/root/gopath
LD_LIBRARY_PATH=/usr/local/TensorRT-8.4.2.4/lib:/usr/local/cuda-11.7/targets/x86_64-
linux/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64
LD_PRELOAD=<not set>
LIBRARY_PATH=/usr/local/cuda/lib64/stubs
PATH=/paddle/anaconda3/bin:/paddle/anaconda3/condabin:/root/.pyenv/plugins/
pyenv-virtualenv/shims:/root/.pyenv/shims:/root/.pyenv/bin:/root/.BClo
ud/bin:/root/bin:/usr/local/bin:/root/.vscode-
server/bin/1.8.401.83.1.02/bin/remote-cli:/root/.pyenv/plugins/pyenv-v
irtualenv/shims:/root/.pyenv/bin:/root/bin:/usr/local/bin:/root/.vscod
e-server/bin/1.8.401.83.1.02/bin:/root/.vscode-
server/bin:/root/.BCloud/bin:/root/.pyenv/plugins/pyenv-
virtualenv/shims:/root/.pyenv/bin:/root/.pyenv/plugins/pyenv-
virtualenv/shims:/root/.pyenv/bin:/root/.pyenv/plugins/pyenv-
virtualenv/shims:/root/.pyenv/bin:/root/.pyenv/plugins/pyenv-
virtualenv/shims:/root/.pyenv/bin:/root/.pyenv/plugins/pyenv-
virtualenv/shims:/root/.pyenv/bin:/root/.pyenv/plugins/pyenv-
virtualenv/shims:/root/.pyenv/bin:/root/.pyenv/plugins/pyenv-
virtualenv/shims:/root/.pyenv/bin:/root/.pyenv/plugins/pyenv-virtualen
v/shims:/root/.pyenv/bin:/root/.pyenv/bin:/root/.pyenv/bin:/root/.pyen
v/bin:/home/cmake-3.16.0-Linux-x86_64/bin:/usr/local/gcc-
8.2/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr
/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/root/gopat
h/bin
REQUESTS_CA_BUNDLE=<not set>
SSL_CERT_FILE=<not set>
active environment : base
active env location : /paddle/anaconda3
shell level : 1
user config file : /root/.condarc
populated config files : /root/.condarc
conda version : 23.7.4
conda-build version : 3.26.1
python version : 3.11.5.final.0
virtual packages : __archspec=1=x86_64
__cuda=12.0=0
__glibc=2.27=0
__linux=5.10.0=0
__unix=0=0
base environment : /paddle/anaconda3 (writable)
conda av data dir : /paddle/anaconda3/etc/conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /paddle/anaconda3/pkgs
/root/.conda/pkgs
envs directories : /paddle/anaconda3/envs
/root/.conda/envs
platform : linux-64
user-agent : conda/23.7.4 requests/2.31.0 CPython/3.11.5 Linux/5.10.0-1.0.0.28 Linux/unknown glibc/2.27 aau/0.4.2 c/jVDR7DkLh6Z7bC9ciaxURQ s/_JNpfqUUE-K4LjwzSnpHDQ e/-9AKlBW4FmrvDG5HlpNbUw
UID:GID : 0:0
netrc file : None
offline mode : False
An unexpected error has occurred. Conda has prepared the above report.
If you suspect this error is being caused by a malfunctioning plugin,
consider using the --no-plugins option to turn off plugins.
Example: conda --no-plugins install <package>
Alternatively, you can set the CONDA_NO_PLUGINS environment variable on
the command line to run the command without plugins enabled.
Example: CONDA_NO_PLUGINS=true conda install <package>
Upload successful.
解决思路:
发现最后报错内容为:
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.
尝试手动运行该代码:
(base) ➜ /paddle lsb_release -a
Traceback (most recent call last):
File "/usr/bin/lsb_release", line 25, in <module>
import lsb_release
ModuleNotFoundError: No module named 'lsb_release'
报错
因此将系统完整的lsb_release.py文件拷贝到报错的目录文件下即可
sudo cp /usr/lib/python3/dist-packages/lsb_release.py /usr/bin/