问题
after installing cloudstorage module using pip when i am trying to import getting following error.
import cloudstorage
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/keshaw/vinv/lib/python2.7/site-packages/cloudstorage/__init__.py", line 56
def get_driver(driver: DriverName) -> Drivers:
^
SyntaxError: invalid syntax
I tried instaling different versions also but same issues
回答1:
Are you using python3? It seems that there is syntax error. Typing
is not available in python2.
Python2:
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> def get_driver(driver: str) -> str:
File "<stdin>", line 1
def get_driver(driver: str) -> str:
^
SyntaxError: invalid syntax
>>>
Python3:
Python 3.5.3 (default, Sep 14 2017, 22:58:41)
[GCC 6.3.0 20170406] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def get_driver(driver: str) -> str:
...
In python3 your syntax should work :)
来源:https://stackoverflow.com/questions/47009532/not-able-to-install-cloudstorage