我正在尝试安装一个插件,该插件似乎是使用 HP 1020 plus 打印机所必需的。运行命令后hp-plugin
,我收到一条错误消息。在下面发布完整的输出:
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use
QT_QPA_PLATFORM=wayland to run on Wayland anyway. Checking for network
connection... Downloading plug-in from: None Traceback (most recent
call last): File "/usr/share/hplip/base/password.py", line 89, in
get_distro_name
os_name = platform.dist()[0] AttributeError: module 'platform' has no attribute 'dist'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"/usr/share/hplip/ui5/plugindialog.py", line 248, in
NextButton_clicked
status, download_plugin_file, error_str = self.pluginObj.download(self.plugin_path,self.plugin_download_callback)
File "/usr/share/hplip/installer/pluginhandler.py", line 257, in
download
core = core_install.CoreInstall() File "/usr/share/hplip/installer/core_install.py", line 241, in __init__
self.passwordObj = password.Password(ui_mode) File "/usr/share/hplip/base/password.py", line 122, in __init__
self.__readAuthType() # self.__authType File "/usr/share/hplip/base/password.py", line 145, in __readAuthType
distro_name = get_distro_name().lower().replace(" ","") File "/usr/share/hplip/base/password.py", line 92, in get_distro_name
os_name = distro.linux_distribution()[0] File "/usr/lib/python3/dist-packages/distro.py", line 125, in
linux_distribution
return _distro.linux_distribution(full_distribution_name) File "/usr/lib/python3/dist-packages/distro.py", line 681, in
linux_distribution
self.version(), File "/usr/lib/python3/dist-packages/distro.py", line 741, in version
self.lsb_release_attr('release'), File "/usr/lib/python3/dist-packages/distro.py", line 903, in
lsb_release_attr
return self._lsb_release_info.get(attribute, '') File "/usr/lib/python3/dist-packages/distro.py", line 556, in __get__
ret = obj.__dict__[self._fname] = self._f(obj) File "/usr/lib/python3/dist-packages/distro.py", line 1014, in
_lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull) File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '('lsb_release', '-a')'
returned non-zero exit status 1. Error in sys.excepthook: Traceback
(most recent call last): File
"/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in
apport_excepthook
with os.fdopen(os.open(pr_filename, PermissionError: [Errno 13] Permission denied: '/var/crash/_usr_share_hplip_plugin.py.1000.crash'
Original exception was: Traceback (most recent call last): File
"/usr/share/hplip/base/password.py", line 89, in get_distro_name
os_name = platform.dist()[0] AttributeError: module 'platform' has no attribute 'dist'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"/usr/share/hplip/ui5/plugindialog.py", line 248, in
NextButton_clicked
status, download_plugin_file, error_str = self.pluginObj.download(self.plugin_path,self.plugin_download_callback)
File "/usr/share/hplip/installer/pluginhandler.py", line 257, in
download
core = core_install.CoreInstall() File "/usr/share/hplip/installer/core_install.py", line 241, in __init__
self.passwordObj = password.Password(ui_mode) File "/usr/share/hplip/base/password.py", line 122, in __init__
self.__readAuthType() # self.__authType File "/usr/share/hplip/base/password.py", line 145, in __readAuthType
distro_name = get_distro_name().lower().replace(" ","") File "/usr/share/hplip/base/password.py", line 92, in get_distro_name
os_name = distro.linux_distribution()[0] File "/usr/lib/python3/dist-packages/distro.py", line 125, in
linux_distribution
return _distro.linux_distribution(full_distribution_name) File "/usr/lib/python3/dist-packages/distro.py", line 681, in
linux_distribution
self.version(), File "/usr/lib/python3/dist-packages/distro.py", line 741, in version
self.lsb_release_attr('release'), File "/usr/lib/python3/dist-packages/distro.py", line 903, in
lsb_release_attr
return self._lsb_release_info.get(attribute, '') File "/usr/lib/python3/dist-packages/distro.py", line 556, in __get__
ret = obj.__dict__[self._fname] = self._f(obj) File "/usr/lib/python3/dist-packages/distro.py", line 1014, in
_lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull) File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '('lsb_release', '-a')'
returned non-zero exit status 1. Checking for network connection...
Downloading plug-in from: None Traceback (most recent call last):
File "/usr/share/hplip/base/password.py", line 89, in get_distro_name
os_name = platform.dist()[0] AttributeError: module 'platform' has no attribute 'dist'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"/usr/share/hplip/ui5/plugindialog.py", line 248, in
NextButton_clicked
status, download_plugin_file, error_str = self.pluginObj.download(self.plugin_path,self.plugin_download_callback)
File "/usr/share/hplip/installer/pluginhandler.py", line 257, in
download
core = core_install.CoreInstall() File "/usr/share/hplip/installer/core_install.py", line 241, in __init__
self.passwordObj = password.Password(ui_mode) File "/usr/share/hplip/base/password.py", line 122, in __init__
self.__readAuthType() # self.__authType File "/usr/share/hplip/base/password.py", line 145, in __readAuthType
distro_name = get_distro_name().lower().replace(" ","") File "/usr/share/hplip/base/password.py", line 92, in get_distro_name
os_name = distro.linux_distribution()[0] File "/usr/lib/python3/dist-packages/distro.py", line 125, in
linux_distribution
return _distro.linux_distribution(full_distribution_name) File "/usr/lib/python3/dist-packages/distro.py", line 681, in
linux_distribution
self.version(), File "/usr/lib/python3/dist-packages/distro.py", line 741, in version
self.lsb_release_attr('release'), File "/usr/lib/python3/dist-packages/distro.py", line 903, in
lsb_release_attr
return self._lsb_release_info.get(attribute, '') File "/usr/lib/python3/dist-packages/distro.py", line 556, in __get__
ret = obj.__dict__[self._fname] = self._f(obj) File "/usr/lib/python3/dist-packages/distro.py", line 1014, in
_lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull) File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '('lsb_release', '-a')'
returned non-zero exit status 1. Error in sys.excepthook: Traceback
(most recent call last): File
"/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in
apport_excepthook
with os.fdopen(os.open(pr_filename, PermissionError: [Errno 13] Permission denied: '/var/crash/_usr_share_hplip_plugin.py.1000.crash'
Original exception was: Traceback (most recent call last): File
"/usr/share/hplip/base/password.py", line 89, in get_distro_name
os_name = platform.dist()[0] AttributeError: module 'platform' has no attribute 'dist'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"/usr/share/hplip/ui5/plugindialog.py", line 248, in
NextButton_clicked
status, download_plugin_file, error_str = self.pluginObj.download(self.plugin_path,self.plugin_download_callback)
File "/usr/share/hplip/installer/pluginhandler.py", line 257, in
download
core = core_install.CoreInstall() File "/usr/share/hplip/installer/core_install.py", line 241, in __init__
self.passwordObj = password.Password(ui_mode) File "/usr/share/hplip/base/password.py", line 122, in __init__
self.__readAuthType() # self.__authType File "/usr/share/hplip/base/password.py", line 145, in __readAuthType
distro_name = get_distro_name().lower().replace(" ","") File "/usr/share/hplip/base/password.py", line 92, in get_distro_name
os_name = distro.linux_distribution()[0] File "/usr/lib/python3/dist-packages/distro.py", line 125, in
linux_distribution
return _distro.linux_distribution(full_distribution_name) File "/usr/lib/python3/dist-packages/distro.py", line 681, in
linux_distribution
self.version(), File "/usr/lib/python3/dist-packages/distro.py", line 741, in version
self.lsb_release_attr('release'), File "/usr/lib/python3/dist-packages/distro.py", line 903, in
lsb_release_attr
return self._lsb_release_info.get(attribute, '') File "/usr/lib/python3/dist-packages/distro.py", line 556, in __get__
ret = obj.__dict__[self._fname] = self._f(obj) File "/usr/lib/python3/dist-packages/distro.py", line 1014, in
_lsb_release_info
stdout = subprocess.check_output(cmd, stderr=devnull) File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '('lsb_release', '-a')'
returned non-zero exit status 1.
我正在使用 Ubuntu 21.10。我是新手,对此一无所知。有人可以帮忙吗?非常感谢!
echo $PATH
返回/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
并且which python3
返回/usr/bin/python3
which python
并且which python2
不返回任何东西。
在聊天会话期间,我们发现了以下内容。
该问题是由二进制安装的 HPLIP 3.21.10 和 deb-packaged 3.21.6 版本混合引起的。
所以我们通过 find ~ -name hplip-3.21.10.run - got /home/mathphy226/softwares/hplip-3.21.10.run 找到了 HPLIP 3.21.10 发行版。然后要求它进行自我删除,如下所示:
然后重新启动以重新安装 deb 打包的 HPLIP 3.21.6
并通过手动下载 HPLIP 插件
稍后使用 hp-plugin -i 安装它。
附加说明:根据官方 HP 文档,此 HP 1020 plus 打印机需要 HPLIP >= 2.7.10,因此不需要二进制 HPLIP。