我是python的初学者。我正在尝试在python中安装Google maps模块,但是我收到了语法错误。以下是错误消息。请帮忙。
(gmapenv) C:\Python\Virtual Environment\gmapenv\Scripts>pip install GoogleMaps
Downloading/unpacking GoogleMaps
Running setup.py egg_info for package GoogleMaps
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "C:\Python\Virtual Environment\gmapenv\build\GoogleMaps\setup.py", li
ne 18, in <module>
import googlemaps
File "googlemaps\googlemaps.py", line 471
print main.__doc__
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "C:\Python\Virtual Environment\gmapenv\build\GoogleMaps\setup.py", line 1
8, in <module>
import googlemaps
File "googlemaps\googlemaps.py", line 471
print main.__doc__
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1 in C:\Python\Virtual E
nvironment\gmapenv\build\GoogleMaps
Storing complete log in C:\Users\Vimal\pip\pip.log
答案 0 :(得分:0)
您似乎尝试使用python3运行python2代码。尝试重新安装python:https://www.python.org/download/releases/2.7/