我尝试了各种方法来安装html2text库,结果ipython无法导入并显示错误消息
“ImportError:没有名为html2text的模块”

The directory '/Users/NDunn/Library/Caches/pip/http' or its parent  directory is not
 owned by the current user and the cache has been disabled.
 Please check the permissions and owner of that directory.
 If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/NDunn/Library/Caches/pip/http' or its parent directory is not owned
by the current user and the cache has been disabled.
Please check the permissions and owner of that directory.
If executing pip with sudo, you may want sudo's -H flag.
Collecting html2text
Installing collected packages: html2text
Successfully installed html2text-2015.6.21

我使用了sudo-Hsudo,它们都说它已经安装,但是我不能导入。
对发生的一切有任何想法都将不胜感激。

最佳答案

在我的例子中(ubuntu14),它只使用了以下命令:

sudo python -m pip install html2text
html2text installed successfully.

10-01 10:45