前提・実現したいこと
Python初心者です。cartopyを導入して、世界地図のプロットを行いたいです。
発生している問題・エラーメッセージ
runfile('/Users/nijori/Desktop/untitled0.py', wdir='/Users/nijori/Desktop') /Users/nijori/opt/anaconda3/lib/python3.7/site-packages/cartopy/io/__init__.py:260: DownloadWarning: Downloading: http://naciscdn.org/naturalearth/110m/physical/ne_110m_coastline.zip warnings.warn('Downloading: {}'.format(url), DownloadWarning) Traceback (most recent call last): File "/Users/nijori/opt/anaconda3/lib/python3.7/urllib/request.py", line 1319, in do_open encode_chunked=req.has_header('Transfer-encoding')) File "/Users/nijori/opt/anaconda3/lib/python3.7/http/client.py", line 1252, in request self._send_request(method, url, body, headers, encode_chunked) File "/Users/nijori/opt/anaconda3/lib/python3.7/http/client.py", line 1298, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/Users/nijori/opt/anaconda3/lib/python3.7/http/client.py", line 1247, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Users/nijori/opt/anaconda3/lib/python3.7/http/client.py", line 1026, in _send_output self.send(msg) File "/Users/nijori/opt/anaconda3/lib/python3.7/http/client.py", line 966, in send self.connect() File "/Users/nijori/opt/anaconda3/lib/python3.7/http/client.py", line 938, in connect (self.host,self.port), self.timeout, self.source_address) File "/Users/nijori/opt/anaconda3/lib/python3.7/socket.py", line 728, in create_connection raise err File "/Users/nijori/opt/anaconda3/lib/python3.7/socket.py", line 716, in create_connection sock.connect(sa) TimeoutError: [Errno 60] Operation timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/IPython/core/formatters.py", line 341, in __call__ return printer(obj) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/IPython/core/pylabtools.py", line 248, in <lambda> png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs)) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/IPython/core/pylabtools.py", line 132, in print_figure fig.canvas.print_figure(bytes_io, **kw) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 2065, in print_figure **kwargs) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py", line 527, in print_png FigureCanvasAgg.draw(self) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py", line 388, in draw self.figure.draw(self.renderer) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/matplotlib/artist.py", line 38, in draw_wrapper return draw(artist, renderer, *args, **kwargs) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/matplotlib/figure.py", line 1709, in draw renderer, self, artists, self.suppressComposite) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/matplotlib/image.py", line 135, in _draw_list_compositing_images a.draw(renderer) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/matplotlib/artist.py", line 38, in draw_wrapper return draw(artist, renderer, *args, **kwargs) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/cartopy/mpl/geoaxes.py", line 388, in draw inframe=inframe) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/matplotlib/artist.py", line 38, in draw_wrapper return draw(artist, renderer, *args, **kwargs) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 2647, in draw mimage._draw_list_compositing_images(renderer, self, artists) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/matplotlib/image.py", line 135, in _draw_list_compositing_images a.draw(renderer) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/matplotlib/artist.py", line 38, in draw_wrapper return draw(artist, renderer, *args, **kwargs) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/cartopy/mpl/feature_artist.py", line 164, in draw geoms = self._feature.intersecting_geometries(extent) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/cartopy/feature/__init__.py", line 303, in intersecting_geometries return super(NaturalEarthFeature, self).intersecting_geometries(extent) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/cartopy/feature/__init__.py", line 120, in intersecting_geometries return (geom for geom in self.geometries() if File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/cartopy/feature/__init__.py", line 287, in geometries name=self.name) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/cartopy/io/shapereader.py", line 359, in natural_earth return ne_downloader.path(format_dict) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/cartopy/io/__init__.py", line 222, in path result_path = self.acquire_resource(target_path, format_dict) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/cartopy/io/shapereader.py", line 414, in acquire_resource shapefile_online = self._urlopen(url) File "/Users/nijori/opt/anaconda3/lib/python3.7/site-packages/cartopy/io/__init__.py", line 261, in _urlopen return urlopen(url) File "/Users/nijori/opt/anaconda3/lib/python3.7/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/Users/nijori/opt/anaconda3/lib/python3.7/urllib/request.py", line 525, in open response = self._open(req, data) File "/Users/nijori/opt/anaconda3/lib/python3.7/urllib/request.py", line 543, in _open '_open', req) File "/Users/nijori/opt/anaconda3/lib/python3.7/urllib/request.py", line 503, in _call_chain result = func(*args) File "/Users/nijori/opt/anaconda3/lib/python3.7/urllib/request.py", line 1347, in http_open return self.do_open(http.client.HTTPConnection, req) File "/Users/nijori/opt/anaconda3/lib/python3.7/urllib/request.py", line 1321, in do_open raise URLError(err) URLError: <urlopen error [Errno 60] Operation timed out> <Figure size 432x288 with 1 Axes>
該当のソースコード
python
1import cartopy.crs as ccrs 2import matplotlib.pyplot as plt 3 4ax = plt.axes(projection=ccrs.PlateCarree()) 5ax.coastlines() 6 7plt.show()
試したこと
簡単のため、公式ページに記載されてあるソースコードを引用して、試しに動かしたところ、エラーが発生しました。
DownloadWarning: Downloading: http://naciscdn.org/naturalearth/110m/physical/ne_110m_coastline.zip
の記載の後、1分間程度停止し、その後下のエラーが発生しました。
cartopyは、conda install -c scitools cartopy でインストールしております。
当方初心者で、右も左もわかりません。
ご迷惑をおかけすることがあるかもしれませんが、何卒よろしくお願いいたします
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/07/14 07:48