Issue
I'm using python 2.7 and pip 20.0.2 and have intalled paramiko pyunpack patool tqdm
packages in my virtual env.
But the below line throws a syntax error. Why would that be?
from pyunpack import Archive
File "/home/../.myvenv/lib/python2.7/site-packages/pyunpack/__init__.py", line 6, in <module>
from easyprocess import EasyProcess
File "/home/../.myvenv/lib/python2.7/site-packages/easyprocess/__init__.py", line 61
cmd: Union[List[str], str],
^
SyntaxError: invalid syntax
Solution
pyunpack
requires python >= 3.7 not python 2 so you should use python 3. As for the specific traceback, python 2 does not support type hints using that syntax
Answered By - Chris_Rands
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.