Reputation: 12162
I tried to install PyRTF
from PyPi but this doesn't work.
The package itself can be found:
$ pip3 search PyRTF
PyRTF (0.45) - PyRTF - Rich Text Format Document Generation
But installing it fails:
$ 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
I am confused.
Upvotes: 6
Views: 6733
Reputation: 88
There is a Python 3 version of PyRTF called PyRTF3. You can find it Here.
PS - Use pip install PyRTF3
or pip install rtfw
for Python 2, pip install PyRTF
doesn't work.
Upvotes: 5
Reputation: 160417
You could use the raw url from the sourceforge page in order to get it:
pip install https://sourceforge.net/projects/pyrtf/files/pyrtf/0.45/PyRTF-0.45.tar.gz/download
But, to be honest, I don't think this library is maintained on the project website the last update was from 2005
, 11 years ago.. Additionally, it uses a line of the form:
from types import StringType
which only exists in Python 2.x
not 3.x
. Importing it raises that specific error too:
>>> 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'
So maybe it was designed for Python 2.x
? I can't remember when StringType
was removed from the 3.x
series, maybe it targeted an old version of it.
Upvotes: 4