简体   繁体   English

google colaboratory中的Python底图

[英]Python basemap in google colaboratory

I used to use the following commands to install libgeos and basemap in google colaboratory and it worked perfectly until last week. 我曾经使用以下命令在google colaboratory中安装libgeos和底图,直到上周它才能完美运行。

!apt-get -qq install libgeos-dev
!pip install -qq https://github.com/matplotlib/basemap/archive/master.zip
from mpl_toolkits.basemap import Basemap, cm

The error shows 错误显示

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-f27b0fbc3a52> in <module>()
----> 1 from mpl_toolkits.basemap import Basemap, cm
      2 from matplotlib.patches import Polygon

/usr/local/lib/python3.6/dist-packages/mpl_toolkits/basemap/__init__.py in 
<module>()
150 
151 # create dictionary that maps epsg codes to Basemap kwargs.
--> 152 epsgf = open(os.path.join(pyproj.pyproj_datadir,'epsg'))
153 epsg_dict={}
154 for line in epsgf:

AttributeError: module 'pyproj' has no attribute 'pyproj_datadir'

Is there anyone know how to fix it? 有没有人知道如何解决它? Thanks. 谢谢。

It seems to have something to do with the latest pyproj release (2.0.1), which was released on 10.03.2019. 它似乎与最新的pyproj版本(2.0.1)有关,该版本于10.03.2019发布。 Try installing older version of pyproj, eg. 尝试安装较旧版本的pyproj,例如。 pip install pyproj==1.9.6

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 google colaboratory 中导入 python 文件? - How to import python files in google colaboratory? 在 Google Colaboratory 上安装并导入 MDAnalysis for Python? 问题 - Install and Import MDAnalysis on Google Colaboratory for Python? Problems 如何在Google合作实验室中以编程方式清除Python输出? - How to Clear Python Output Programatically in Google Colaboratory? 如何在 Google Colaboratory Python Notebook 中使用 Flask? - How to use Flask in Google Colaboratory Python Notebook? 在 google colaboratory 中使用 python 抓取深度网络数据 - Deep web data scraping with python in google colaboratory 合作-记住Google Drive Auth(Python) - Colaboratory - Remember Google Drive Auth (Python) 如何在QGIS的python代码中获取谷歌底图? - How to get a google basemap in a python code for QGIS? Google Colaboratory 中的 Python - 如何在 Google Drive 中创建、写入和读取文件 - Python in Google Colaboratory - How to create, write and read files in google drive 如何在Python IDE中使用Google Colaboratory服务器作为python解释器? - How to use Google Colaboratory server as python interpreter in Python IDE? 如何在不剪切python的情况下从Google colaboratory保存图像? - How to save an image from google colaboratory without cutting it in python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM