uqfoundation / ppft

distributed and parallel Python
http://ppft.rtfd.io
Other
67 stars 14 forks source link

Importing fails in Python 3 due to print syntax #25

Closed weableandbob closed 3 years ago

weableandbob commented 3 years ago

I get the following when attempting to import pathos, and by extension ppft, in Python 3.8:

  File "/usr/local/google/home/bsheedy/.vpython-root/2054ef/lib/python3.8/site-packages/pathos/__init__.py", line 55, in <module>
    from . import pools
  File "/usr/local/google/home/bsheedy/.vpython-root/2054ef/lib/python3.8/site-packages/pathos/pools.py", line 31, in <module>
    from pathos.helpers import ProcessPool as _ProcessPool
  File "/usr/local/google/home/bsheedy/.vpython-root/2054ef/lib/python3.8/site-packages/pathos/helpers/__init__.py", line 9, in <module>
    from . import pp_helper
  File "/usr/local/google/home/bsheedy/.vpython-root/2054ef/lib/python3.8/site-packages/pathos/helpers/pp_helper.py", line 30, in <module>
    from pp import _Task
  File "/usr/local/google/home/bsheedy/.vpython-root/2054ef/lib/python3.8/site-packages/pp/__init__.py", line 12, in <module>
    from ._pp import *
  File "/usr/local/google/home/bsheedy/.vpython-root/2054ef/lib/python3.8/site-packages/pp/_pp.py", line 138
    print sout,
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(sout, end=" ")?

This is with pathos 0.2.7 and ppft 1.6.6.3.

The line in question is still there on master https://github.com/uqfoundation/ppft/blob/master/pp/_pp.py#L138, and there are a number of other unparenthesized prints elsewhere in the file.

mmckerns commented 3 years ago

Looks like this is because the import for ppft is import ppft and not import pp. The latter being the legacy import, and appears to not have been updated since the python 3 conversion a long while ago. ppft requires a weird import structure, and... anyway... I've copied pasted the appropriate files from ppft into pp. Thanks for catching that! A new release will be coming shortly.

mmckerns commented 3 years ago

0212f554b964ec3200d930ffb48890ae2178ee59

weableandbob commented 3 years ago

Thanks for the fix! Is there an ETA on the release that will include this? Wondering if we should wait for that or just apply the fix locally.

mmckerns commented 3 years ago

I have a release scheduled for just over a week from now

mmckerns commented 3 years ago

I'm closing this. Please feel free to reopen if you find it persists.