Nalini
Nalini

Reputation: 1

I get "SyntaxError" for rst2pdf command after installing RST2PDF in Windows 7

After I install RST2PDF in Windows 7, and run the command rst2pdf or rst2pdf -h, it says

SyntxError: Invalid syntax

I installed rst2pdf V.93 using PIP and have set the path to scripts in python directory.

Here is the error:

c:>rst2pdf Traceback (most recent call last): File "C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\Scripts\rst2pd f-script.py", line 9, in load_entry_point('rst2pdf===0.93.dev-r0', 'console_scripts', 'rst2pdf')() File "C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa ges\pkg_resources__init__.py", line 558, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa ges\pkg_resources__init__.py", line 2682, in load_entry_point return ep.load() File "C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa ges\pkg_resources__init__.py", line 2355, in load return self.resolve() File "C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa ges\pkg_resources__init__.py", line 2361, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "C:\Users\IBM_ADMIN\AppData\Local\Programs\Python\Python35\lib\site-packa ges\rst2pdf\createpdf.py", line 695 except ValueError, v: ^ SyntaxError: invalid syntax

Upvotes: 0

Views: 511

Answers (1)

EvertW
EvertW

Reputation: 1180

The syntax for exception handling changed with python 3: instead of except ValueError, v one must use except ValueError as v.

Apparently, rst2pdf has no support for python3. To use it, you must have python2.7 installed. Some attempts have been made to port rst2pdf, but the efforts seem to have stalled.

Alternatively, you may try to use pandoc, as suggested here

Upvotes: 0

Related Questions