0
我是一名Python初學者。我正在嘗試在python中安裝Google maps模塊,但是我收到了語法錯誤。以下是錯誤消息。請幫忙。嘗試通過pip在python中安裝googlemaps模塊時出現語法錯誤
(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
是否應該導入GoogleMaps而不是導入Google地圖 – heinst
python 2和3不兼容 – Fabricator
@heinst謝謝您的回答。我從未使用過導入語句。我試圖安裝googlemaps模塊,並得到了錯誤信息 – user3777324