SyntaxError: invalid syntax when running the pynt command
saggar opened this issue · 3 comments
I followed the steps as per https://github.com/aws-samples/aws-etl-orchestrator, but when I run pynt
the following error is shown. I tried both python3 and python 2.7 while creating the virtualenv
. And having print statement in the same line didn't work either.
(etl-orchestrator) 8c85902107ff:aws-etl-orchestrator saggars$ python -V
Python 3.6.5
(etl-orchestrator) 8c85902107ff:aws-etl-orchestrator saggars$ pynt -v
pynt 0.8.2
(etl-orchestrator) 8c85902107ff:aws-etl-orchestrator saggars$ pynt
Traceback (most recent call last):
File "/Volumes/Unix/MAC-DEV-DSK/EconETLOrchestrator/etl-orchestrator/bin/pynt", line 11, in <module>
sys.exit(main())
File "/Volumes/Unix/MAC-DEV-DSK/EconETLOrchestrator/etl-orchestrator/lib/python3.6/site-packages/pynt/_pynt.py", line 298, in main
build(sys.argv[1:])
File "/Volumes/Unix/MAC-DEV-DSK/EconETLOrchestrator/etl-orchestrator/lib/python3.6/site-packages/pynt/_pynt.py", line 48, in build
module = imp.load_source(path.splitext(path.basename(args.file))[0], args.file)
File "/Volumes/Unix/MAC-DEV-DSK/EconETLOrchestrator/etl-orchestrator/lib/python3.6/imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 684, in _load
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 674, in exec_module
File "<frozen importlib._bootstrap_external>", line 781, in get_code
File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "build.py", line 34
print 'zipping %s as %s' % (os.path.join(dirname, filename),
^
SyntaxError: invalid syntax
Convert all your print statements to use the function and it will fine. So in your error line above change to: print('zipping %s as %s' % (os.path.join(dirname, filename),??)
Search on "print" there are several to update.
Let me just qualify this for people - if you've created a virtualEnv using python 3.5.6, then yes, you'll need to put all your print statements (there are 32) from:
print 'doing something'
to
print('doing something')
print statements were updated throughout the project to be Python 3 compatible.