-5
[joepareti54@xxx build]$ ./manta ../scenes/_trainingData.py --dim 3 --addModelGeometry True --addSphereGeometry True
Version: mantaflow 64bit fp1 commit dd3bb0c0a65cc531d3c33487bde5edcb4aa6784f from Mar 14 2018, 14:53:44
Loading script '../scenes/_trainingData.py'
Traceback (most recent call last):
  File "../scenes/_trainingData.py", line 12, in <module>
    from Emitter import *
  File "/home/joepareti54/FluidNet/manta/scenes/Emitter.py", line 15, in <module>
    import matlabnoise
  File "/home/joepareti54/FluidNet/manta/build/../../../matlabnoise/matlabnoise.py", line 81
    def Perlin2D(*args) -> "double" :
                        ^
SyntaxError: invalid syntax

I believe the invalid syntax occurs in:

def Perlin2D(*args) -> "double" :`enter code here`
  return _matlabnoise.Perlin2D(*args)
Perlin2D = _matlabnoise.Perlin2D
Duncan
  • 92,073
  • 11
  • 122
  • 156
joseph pareti
  • 97
  • 1
  • 9
  • 2
    You're running the script in a Python version incompatible with what the script requires. – deceze Mar 15 '18 at 10:16
  • thanks folks, and thanks for formatting my post ... I am not really sure: [joepareti54@xxx build]$ which python /anaconda/envs/py35/bin/python [joepareti54@xxx build]$ however renaming the above definition is inconsequential, i.e. the ./manta command returns exactly the same error – joseph pareti Mar 15 '18 at 10:32

1 Answers1

1

Your problem is that mantaflow is running an embedded Python, so the version used is the one that was available when mantaflow was compiled and it appears that version does not support the type annotations introduced in Python 3.5

When you run which python that shows you the version of Python installed on your system, not the version compiled into the other program.

Solutions include recompiling mantaflow with a more recent Python, or stop using type annotations.

Duncan
  • 92,073
  • 11
  • 122
  • 156
  • thank you: because the first step to build manta involves using cmake, I found the following hints to specify another version of python -- not tried it out yet just to avoid screwing up --- https://stackoverflow.com/questions/15291500/i-have-2-versions-of-python-installed-but-cmake-is-using-older-version-how-do – joseph pareti Mar 16 '18 at 10:42
  • can anybody propose a python 2 - compatible re-write of the function "def Perlin2D" listed above --- Thx – joseph pareti Mar 20 '18 at 20:52
  • @josephpareti, just remove the `-> "double"` and it should run on Python2 – Duncan Mar 21 '18 at 11:42