Not able to install cloudstorage

别等时光非礼了梦想. 提交于 2020-01-16 08:45:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!