3

I am trying to import the paraview.simple module from Paraview 5.2 into the new Python 3.6.2 using IDLE. Unfortunately it appears this module is using the old print statement as suggested by this error message:

>>> import paraview.simple
Traceback (most recent call last):
  File "<pyshell#50>", line 1, in <module>
    import paraview.simple
  File "C:\Program Files\ParaView 5.0.1\lib\paraview-5.0\site-packages\paraview\__init__.py", line 129
    print text
             ^
SyntaxError: Missing parentheses in call to 'print'

I really want to use this version of python? There are other modules I wish to use alongside paraview.simple which are only compatible with the latest version of python. How can I circumvent this minor print issue and import the modules I need?

user32882
  • 3,135
  • 2
  • 20
  • 47
  • 1
    Would you want to convert the paraview.simple module from version 2 to 3? If yes, then you can use - "2to3". A program to convert python2 code to python3. Link - https://docs.python.org/2/library/2to3.html – Shashank Jul 20 '17 at 12:47
  • https://docs.python.org/3.0/library/2to3.html https://stackoverflow.com/questions/11071037/how-to-use-2to3-tool-in-windows https://stackoverflow.com/questions/20458011/how-to-use-2to3-properly-for-python – bendl Jul 20 '17 at 12:53

1 Answers1

0

It seems like the question might not be relevant anymore since paraview hasn't been supported for long time (at least there haven't been any pull requests since 2017 https://github.com/Kitware/ParaView/pulls).

For those who still want to use it there is a solution as pointed by @Shashank in the comments: just convert it from python2 to python3 using 2to3 or similar tool.

Roman Nakutnyi
  • 341
  • 2
  • 7