我试图从PyRTF中安装PyPi,但这不起作用。
可以找到包裹本身:
$ pip3 search PyRTF
PyRTF (0.45) - PyRTF - Rich Text Format Document Generation但是安装它失败了:
$ sudo -H pip3 install PyRTF
Collecting PyRTF
Could not find a version that satisfies the requirement PyRTF (from versions: )
No matching distribution found for PyRTF我很困惑。
发布于 2018-02-16 12:20:47
有一个称为PyRTF3的Python3版本的PyRTF3。你可以找到它,这里。
PS -对Python2使用pip install PyRTF3或pip install rtfw,pip install PyRTF不起作用。
发布于 2016-07-01 01:07:48
您可以使用sourceforge页面中的原始url来获得它:
pip install https://sourceforge.net/projects/pyrtf/files/pyrtf/0.45/PyRTF-0.45.tar.gz/download 但是,老实说,我不认为这个库是在项目网站上维护的,上一次更新是来自2005,11年前。此外,它还使用了表单的一行:
from types import StringType它只存在于Python 2.x中,而不存在于3.x中。导入它也会引发特定错误:
>>> import PyRTF
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jim/anaconda3/lib/python3.5/site-packages/PyRTF/__init__.py", line 1, in <module>
from PropertySets import *
File "/home/jim/anaconda3/lib/python3.5/site-packages/PyRTF/PropertySets.py", line 12, in <module>
from types import StringType
ImportError: cannot import name 'StringType'所以也许它是为Python 2.x设计的?我不记得StringType是什么时候从3.x系列中删除的,也许它是针对旧版本的。
https://stackoverflow.com/questions/38135344
复制相似问题