当我运行/usr/bin/click时,会得到以下错误:
Traceback (most recent call last):
File "/usr/bin/click", line 37, in <module>
import click
ImportError: No module named 'click'我试图重新安装软件包,但在安装过程中也出现了相同的错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/14,7 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 255715 files and directories currently installed.)
Preparing to unpack .../click_0.4.45.1+16.10.20160916-0ubuntu1_amd64.deb ...
Unpacking click (0.4.45.1+16.10.20160916-0ubuntu1) over (0.4.45.1+16.10.20160916-0ubuntu1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up click (0.4.45.1+16.10.20160916-0ubuntu1) ...
Traceback (most recent call last):
File "/usr/bin/click", line 37, in <module>
import click
ImportError: No module named 'click'
dpkg: error processing package click (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for shared-mime-info (1.7-1) ...
Errors were encountered while processing:
click
E: Sub-process /usr/bin/dpkg returned an error code (1)我已经删除了另一个包click,它来自pip3,但没有帮助。似乎系统中没有必需的文件(我相信它们的源代码是这里),或者python找不到它。
因此,问题是: python包click应该定位在哪里,以及如何修复错误。
发布于 2017-02-24 12:32:21
终于找到了解决办法!在我的例子中,python模块click来自智能包python3-click-package。但是,它已经被另一个模块click覆盖。在我移除后一个模块后,python3-click-package就坏了,所以我只是重新安装它,这样click就可以工作了:
sudo apt install --reinstall python3-click-packagehttps://askubuntu.com/questions/886100
复制相似问题