- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
shell 命令 pip install cartopy
导致了几个错误。
一开始出现如下错误:
ERROR: Command errored out with exit status 1:
command: /home/linuxbrew/.linuxbrew/opt/python@3.8/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-j47_isf2/cartopy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-j47_isf2/cartopy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-a9f6gipd
cwd: /tmp/pip-install-j47_isf2/cartopy/
Complete output (3 lines):
/tmp/pip-install-j47_isf2/cartopy/setup.py:157: UserWarning: Unable to determine Proj version. Ensure you have 4.9.0 or later installed, or installation may fail.
warnings.warn(
Proj version 0.0.0 is installed, but cartopy requires at least version 4.9.0.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
在重新安装 proj4 并尝试在我的 .bashrc
文件中传递环境变量后,比如
export PROJ_LIB=/home/linuxbrew/.linuxbrew/bin/proj
export PROJ=/home/linuxbrew/.linuxbrew/bin/proj
错误消息更改如下:
andylu@andylu-ThinkPad-Edge-E130:~/$ pip install cartopy
Collecting cartopy
Using cached Cartopy-0.18.0.tar.gz (14.4 MB)
Requirement already satisfied: numpy>=1.10 in /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages (from cartopy) (1.19.1)
Requirement already satisfied: shapely>=1.5.6 in /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages (from cartopy) (1.7.0)
Requirement already satisfied: pyshp>=1.1.4 in /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages (from cartopy) (2.1.0)
Requirement already satisfied: six>=1.3.0 in /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages (from cartopy) (1.15.0)
Requirement already satisfied: setuptools>=0.7.2 in /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages (from cartopy) (49.2.1)
Building wheels for collected packages: cartopy
Building wheel for cartopy (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/linuxbrew/.linuxbrew/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-81mh5l39/cartopy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-81mh5l39/cartopy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-v0pstk7_
cwd: /tmp/pip-install-81mh5l39/cartopy/
Complete output (272 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/cartopy
...
I/home/linuxbrew/.linuxbrew/opt/python@3.8/include/python3.8 -c lib/cartopy/trace.cpp -o build/temp.linux-x86_64-3.8/lib/cartopy/trace.o
lib/cartopy/trace.cpp: In function 'void __pyx_f_7cartopy_5trace__project_segment(GEOSContextHandle_t, const GEOSCoordSequence*, unsigned int, unsigned int, __pyx_obj_7cartopy_5trace_Interpolator*, const GEOSPreparedGeometry*, double, __pyx_obj_7cartopy_5trace_LineAccumulator*)':
lib/cartopy/trace.cpp:6362:52: warning: '__pyx_v_t_max' may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_t_2 = PyFloat_FromDouble(__pyx_v_t_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
^
lib/cartopy/trace.cpp:6360:52: warning: '__pyx_v_t_min' may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_t_3 = PyFloat_FromDouble(__pyx_v_t_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
^
c++ -pthread -shared -L/home/linuxbrew/.linuxbrew/lib build/temp.linux-x86_64-3.8/lib/cartopy/trace.o -L/home/linuxbrew/.linuxbrew/opt/python@3.8/lib -L/home/linuxbrew/.linuxbrew/Cellar/proj/7.1.0/lib -L/home/linuxbrew/.linuxbrew/Cellar/geos/3.8.1_1/lib -L/home/linuxbrew/.linuxbrew/lib -L/home/linuxbrew/.linuxbrew/opt/openssl@1.1/lib -L/home/linuxbrew/.linuxbrew/opt/sqlite/lib -L/home/linuxbrew/.linuxbrew/opt/python@3.8/lib -R/home/linuxbrew/.linuxbrew/opt/python@3.8/lib -lproj -lgeos_c -o build/lib.linux-x86_64-3.8/cartopy/trace.cpython-38-x86_64-linux-gnu.so
c++: error: unrecognized command line option '-R'
error: command 'c++' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for cartopy
Running setup.py clean for cartopy
Failed to build cartopy
DEPRECATION: Could not build wheels for cartopy which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: cartopy
Running setup.py install for cartopy ... error
ERROR: Command errored out with exit status 1:
command: /home/linuxbrew/.linuxbrew/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-81mh5l39/cartopy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-81mh5l39/cartopy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lmvk94_o/install-record.txt --single-version-externally-managed --compile --install-headers /home/linuxbrew/.linuxbrew/include/python3.8/cartopy
cwd: /tmp/pip-install-81mh5l39/cartopy/
Complete output (272 lines):
running install
running build
...
building 'cartopy.trace' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/lib
creating build/temp.linux-x86_64-3.8/lib/cartopy
cc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1 -I/home/linuxbrew/.linuxbrew/opt/python@3.8/include -I./lib/cartopy -I/home/linuxbrew/.linuxbrew/lib/python3.8/site-packages/numpy/core/include -I/home/linuxbrew/.linuxbrew/Cellar/proj/7.1.0/include -I/home/linuxbrew/.linuxbrew/Cellar/geos/3.8.1_1/include -I/home/linuxbrew/.linuxbrew/include -I/home/linuxbrew/.linuxbrew/opt/openssl@1.1/include -I/home/linuxbrew/.linuxbrew/opt/sqlite/include -I/home/linuxbrew/.linuxbrew/opt/python@3.8/include/python3.8 -c lib/cartopy/trace.cpp -o build/temp.linux-x86_64-3.8/lib/cartopy/trace.o
lib/cartopy/trace.cpp: In function 'void __pyx_f_7cartopy_5trace__project_segment(GEOSContextHandle_t, const GEOSCoordSequence*, unsigned int, unsigned int, __pyx_obj_7cartopy_5trace_Interpolator*, const GEOSPreparedGeometry*, double, __pyx_obj_7cartopy_5trace_LineAccumulator*)':
lib/cartopy/trace.cpp:6362:52: warning: '__pyx_v_t_max' may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_t_2 = PyFloat_FromDouble(__pyx_v_t_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
^
lib/cartopy/trace.cpp:6360:52: warning: '__pyx_v_t_min' may be used uninitialized in this function [-Wmaybe-uninitialized]
__pyx_t_3 = PyFloat_FromDouble(__pyx_v_t_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
^
c++ -pthread -shared -L/home/linuxbrew/.linuxbrew/lib build/temp.linux-x86_64-3.8/lib/cartopy/trace.o -L/home/linuxbrew/.linuxbrew/opt/python@3.8/lib -L/home/linuxbrew/.linuxbrew/Cellar/proj/7.1.0/lib -L/home/linuxbrew/.linuxbrew/Cellar/geos/3.8.1_1/lib -L/home/linuxbrew/.linuxbrew/lib -L/home/linuxbrew/.linuxbrew/opt/openssl@1.1/lib -L/home/linuxbrew/.linuxbrew/opt/sqlite/lib -L/home/linuxbrew/.linuxbrew/opt/python@3.8/lib -R/home/linuxbrew/.linuxbrew/opt/python@3.8/lib -lproj -lgeos_c -o build/lib.linux-x86_64-3.8/cartopy/trace.cpython-38-x86_64-linux-gnu.so
c++: error: unrecognized command line option '-R'
error: command 'c++' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/linuxbrew/.linuxbrew/opt/python@3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-81mh5l39/cartopy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-81mh5l39/cartopy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-lmvk94_o/install-record.txt --single-version-externally-managed --compile --install-headers /home/linuxbrew/.linuxbrew/include/python3.8/cartopy Check the logs for full command output.
完整的环境定义
卢本图 18.04 64 位
Collecting cartopy
Using cached Cartopy-0.18.0.tar.gz (14.4 MB)
Package Version
----------------------------- ------------
affine 2.3.0
aiohttp 3.6.2
alabaster 0.7.12
argon2-cffi 20.1.0
arrow 0.15.8
asgiref 3.2.10
astroid 2.4.2
async-timeout 3.0.1
attrs 19.3.0
Babel 2.8.0
backcall 0.2.0
beautifulsoup4 4.9.1
bleach 3.1.5
bokeh 2.1.1
Bottleneck 1.3.2
branca 0.4.1
bs4 0.0.1
cachetools 4.1.1
cdsapi 0.3.0
certifi 2020.6.20
cffi 1.14.1
cftime 1.2.1
chardet 3.0.4
click 7.1.2
click-plugins 1.1.1
cligj 0.5.0
cloudpickle 1.5.0
colorama 0.4.3
coverage 5.2.1
cycler 0.10.0
Cython 0.29.21
dask 2.22.0
decorator 4.4.2
defusedxml 0.6.0
descartes 1.1.0
distributed 2.22.0
Django 3.0.9
docutils 0.16
entrypoints 0.3
et-xmlfile 1.0.1
filelock 3.0.12
Fiona 1.8.13.post1
flake8 3.8.3
Flask 1.1.2
folium 0.11.0
fsspec 0.8.0
geojson 2.5.0
geojsoncontour 0.4.0
geopandas 0.8.1
geos 0.2.2
gevent 20.6.2
google 3.0.0
google-api-core 1.22.0
google-auth 1.20.0
google-auth-oauthlib 0.4.1
google-cloud-bigquery 1.26.1
google-cloud-core 1.3.0
google-crc32c 0.1.0
google-resumable-media 0.7.0
googleapis-common-protos 1.52.0
greenlet 0.4.16
grpcio 1.30.0
h5py 2.10.0
HeapDict 1.0.1
html5lib 1.1
hypothesis 5.23.9
idna 2.10
imagesize 1.2.0
imgkit 1.0.2
importlib-metadata 1.7.0
iniconfig 1.0.1
ipykernel 5.3.4
ipython 7.17.0
ipython-genutils 0.2.0
ipywidgets 7.5.1
isort 5.2.2
itsdangerous 1.1.0
jdcal 1.4.1
jedi 0.17.2
Jinja2 2.11.2
joblib 0.16.0
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 6.1.6
jupyter-console 6.1.0
jupyter-core 4.6.3
kiwisolver 1.2.0
lazy-object-proxy 1.5.1
locket 0.2.0
lxml 4.5.2
MarkupSafe 1.1.1
matplotlib 3.3.0
mccabe 0.6.1
mistune 0.8.4
modin 0.8.0
more-itertools 8.4.0
mpmath 1.1.0
msgpack 1.0.0
multidict 4.7.6
munch 2.5.0
nbconvert 5.6.1
nbformat 5.0.7
netCDF4 1.5.4
networkx 2.4
notebook 6.1.0
numexpr 2.7.1
numpy 1.19.1
oauthlib 3.1.0
openpyxl 3.0.4
osmnx 0.15.1
OWSLib 0.20.0
packaging 20.4
pandas 1.1.0
pandas-datareader 0.9.0
pandas-gbq 0.13.2
pandocfilters 1.4.2
parso 0.7.1
partd 1.1.0
patsy 0.5.1
pdfkit 0.6.1
pep8 1.7.1
pexpect 4.8.0
pickle5 0.0.11
pickleshare 0.7.5
Pillow 7.2.0
pip 20.2
planar 0.4
plotly 4.9.0
pluggy 0.13.1
proj 0.2.0
prometheus-client 0.8.0
prompt-toolkit 3.0.5
protobuf 3.12.4
psutil 5.7.2
ptyprocess 0.6.0
py 1.9.0
py-spy 0.3.3
pyarrow 0.16.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycodestyle 2.6.0
pycparser 2.20
pydata-google-auth 1.1.0
pyepsg 0.4.0
pyflakes 2.2.0
Pygments 2.6.1
pyhdf 0.10.2
pykdtree 1.3.1
pylint 2.5.3
pylint-django 2.2.0
pylint-plugin-utils 0.6
pyparsing 2.4.7
pyproj 2.6.1.post1
PyQt5 5.15.0
PyQt5-sip 12.8.0
pyrsistent 0.16.0
pyshp 2.1.0
PySide2 5.15.0
pytest 6.0.1
pytest-cov 2.10.0
pytest-filter-subpackage 0.1.1
python-dateutil 2.8.1
pytz 2020.1
PyYAML 5.3.1
pyzmq 19.0.2
qtconsole 4.7.5
QtPy 1.9.0
rasterio 1.1.5
ray 0.8.6
redis 3.4.1
regex 2020.7.14
requests 2.24.0
requests-oauthlib 1.3.0
retrying 1.3.3
rsa 4.6
Rtree 0.9.4
salem 0.2.4
scikit-learn 0.23.1
scipy 1.5.2
seaborn 0.10.1
Send2Trash 1.5.0
setuptools 49.2.1
Shapely 1.7.0
shiboken2 5.15.0
six 1.15.0
sklearn 0.0
snowballstemmer 2.0.0
snuggs 1.4.7
sortedcollections 1.2.1
sortedcontainers 2.2.2
soupsieve 2.0.1
Sphinx 3.1.2
sphinxcontrib-applehelp 1.0.2
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 1.0.3
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.4
SQLAlchemy 1.3.18
sqlparse 0.3.1
statsmodels 0.11.1
swifter 1.0.2
sympy 1.6.1
tables 3.6.1
tblib 1.7.0
terminado 0.8.3
testpath 0.4.4
threadpoolctl 2.1.0
toml 0.10.1
toolz 0.10.0
tornado 6.0.4
tqdm 4.48.1
traitlets 4.3.3
typed-ast 1.4.1
typing-extensions 3.7.4.2
urllib3 1.25.10
wcwidth 0.2.5
webcolors 1.11.1
webencodings 0.5.1
Werkzeug 1.0.1
wheel 0.34.2
widgetsnbextension 3.5.1
windrose 1.6.7
wrapt 1.12.1
xarray 0.16.0
xlrd 1.2.0
XlsxWriter 1.3.1
yapf 0.30.0
yarl 1.5.1
zict 2.0.0
zipp 3.1.0
zope.event 4.4
zope.interface 5.1.0
最佳答案
在搜索主要错误信息 c++: error: unrecognized command line option '-R'
的解决方案后,我终于找到了 in this discussion .
我所做的是使用强大的 find
方法搜索相关文件:
andylu@andylu-ThinkPad-Edge-E130:~/Desktop/Python/Scripts$ sudo find / -type f -iname "unixccompiler.py"
find: ‘/run/user/1000/gvfs’: Permission denied
find: ‘/tmp/.mount_pcloudgeFVGR’: Permission denied
/snap/core/9436/usr/lib/python3.5/distutils/unixccompiler.py
/snap/core/9665/usr/lib/python3.5/distutils/unixccompiler.py
/snap/gimp/281/usr/lib/python2.7/distutils/unixccompiler.py
/snap/gimp/273/usr/lib/python2.7/distutils/unixccompiler.py
/snap/core18/1880/usr/lib/python3.6/distutils/unixccompiler.py
/snap/core18/1880/usr/lib/python3.7/distutils/unixccompiler.py
/snap/core18/1880/usr/lib/python3.8/distutils/unixccompiler.py
/snap/core18/1754/usr/lib/python3.6/distutils/unixccompiler.py
/snap/core18/1754/usr/lib/python3.7/distutils/unixccompiler.py
/snap/core18/1754/usr/lib/python3.8/distutils/unixccompiler.py
/usr/lib/python3.8/distutils/unixccompiler.py
/usr/lib/python3.6/distutils/unixccompiler.py
/usr/lib/python3/dist-packages/numpy/distutils/unixccompiler.py
/usr/lib/python3.7/distutils/unixccompiler.py
/usr/lib/python2.7/distutils/unixccompiler.py
/usr/lib/python2.7/dist-packages/numpy/distutils/unixccompiler.py
find: ‘/home/andylu/pCloudDrive’: Permission denied
/home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/libexec/setuptools/build/lib/setuptools/_distutils/unixccompiler.py
/home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/libexec/setuptools/setuptools/_distutils/unixccompiler.py
/home/linuxbrew/.linuxbrew/Cellar/python@3.8/3.8.5/lib/python3.8/distutils/unixccompiler.py
/home/linuxbrew/.linuxbrew/Cellar/numpy/1.19.1/lib/python3.8/site-packages/numpy/distutils/unixccompiler.py
/home/linuxbrew/.linuxbrew/lib/python3.8/site-packages/numpy/distutils/unixccompiler.py
/home/linuxbrew/.linuxbrew/lib/python3.8/site-packages/setuptools/_distutils/unixccompiler.py
接下来,我在文本编辑器 VS Code
中打开了包含当前使用的 3.8 版
的相关 python 文件。然后,我在这些文件中搜索“-R”以找到以下代码段:
else:
if self._is_gcc(compiler):
# gcc on non-GNU systems does not need -Wl, but can
# use it anyway. Since distutils has always passed in
# -Wl whenever gcc was used in the past it is probably
# safest to keep doing so.
if sysconfig.get_config_var("GNULD") == "yes":
# GNU ld needs an extra option to get a RUNPATH
# instead of just an RPATH.
return "-Wl,--enable-new-dtags,-R" + dir
else:
return "-Wl,-R" + dir
else:
# No idea how --enable-new-dtags would be passed on to
# ld if this system was using GNU ld. Don't know if a
# system like this even exists.
return "-R" + dir
在这段代码中,我将 "-R"
替换为 "-rpath="
和最终的独立 "-R"
(上面代码段的最后一行)即使使用 '-Wl,-rpath='
。完成后,代码片段如下所示:
else:
if self._is_gcc(compiler):
# gcc on non-GNU systems does not need -Wl, but can
# use it anyway. Since distutils has always passed in
# -Wl whenever gcc was used in the past it is probably
# safest to keep doing so.
if sysconfig.get_config_var("GNULD") == "yes":
# GNU ld needs an extra option to get a RUNPATH
# instead of just an RPATH.
return "-Wl,--enable-new-dtags,-rpath=" + dir
else:
return "-Wl,-rpath=" + dir
else:
# No idea how --enable-new-dtags would be passed on to
# ld if this system was using GNU ld. Don't know if a
# system like this even exists.
return "-Wl,-rpath=" + dir
保存并关闭上述修改后的python-scripts后,cartopy的安装终于成功了:
andylu@andylu-ThinkPad-Edge-E130:~/Desktop/Python/Scripts$ pip install cartopy
Collecting cartopy
Using cached Cartopy-0.18.0.tar.gz (14.4 MB)
Requirement already satisfied: numpy>=1.10 in /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages (from cartopy) (1.19.1)
Requirement already satisfied: shapely>=1.5.6 in /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages (from cartopy) (1.7.0)
Requirement already satisfied: pyshp>=1.1.4 in /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages (from cartopy) (2.1.0)
Requirement already satisfied: six>=1.3.0 in /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages (from cartopy) (1.15.0)
Requirement already satisfied: setuptools>=0.7.2 in /home/linuxbrew/.linuxbrew/lib/python3.8/site-packages (from cartopy) (49.2.1)
Building wheels for collected packages: cartopy
Building wheel for cartopy (setup.py) ... done
Created wheel for cartopy: filename=Cartopy-0.18.0-cp38-cp38-linux_x86_64.whl size=15743039 sha256=b95932012d877432db8e629bdc77e730227f93f94515a54e59e4c6fb6a85bdad
Stored in directory: /home/andylu/.cache/pip/wheels/7c/3c/68/ed800c08e3e6579b632fdd26becee97c5c5474625f6c97eca6
Successfully built cartopy
Installing collected packages: cartopy
Successfully installed cartopy-0.18.0
关于python - 在 Linux Ubuntu 18.04 上从 pip 安装 cartopy 退出并出现各种错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63236626/
我画了两组重叠的轴,一组是另一组的放大版。我想在缩放轴的角和它在较大轴上代表的矩形的角之间画线。但是,我画的线稍微偏离了位置。我试图将其浓缩为一个简单的示例: import cartopy.crs a
我想知道给定纬度和经度,坐标是陆地还是海洋 根据https://gis.stackexchange.com/questions/235133/checking-if-a-geocoordinate-p
我已经看到了一些关于这个主题的其他问题,但是库已经发生了很大的变化,以至于这些问题的答案似乎不再适用。 栅格 used to include an example用于在 Cartopy GeoAxes
我正在为 xarray 进行一些开发。我试图安装 rasterio 但它似乎搞砸了我的 cartopy 安装。 我在我的 mac 上安装了 rasterio: brew install gdal pi
使用 basemap ,我曾经像这样添加我的自定义边界 shapefile: map = Basemap(..) map.readshapefile(file.shp, 'attribute', dr
所以,多年来我一直在 Python 2.7 中使用 Basemap,我正在转向 Python3.7 并且想转向 cartopy。我处理大量数据,其中我有投影信息,但我没有数据的纬度和经度网格。这就是我
我想要制作一个点的动画,该点沿着 map 上的一个位置到另一个位置的路径移动。 例如,我使用大地测量变换绘制了从纽约到新德里的路径。例如。取自文档 Adding data to the map plt
我想绘制来自全局多维数据集的数据,但仅限于国家/地区列表。因此,我根据国家/地区的“边界框”选择一个子立方体。 到目前为止一切顺利。我正在寻找一种简单的方法来掩盖立方体中不属于我的任何国家/地区的所有
如果我定义一组具有给定高度和宽度的(地理)轴,我如何确保绘图将填充这些轴? import matplotlib.pyplot as plt import cartopy.crs as ccrs ax
我有两个 shapefile。一个是点要素 shapefile,名为“point.shp”,另一个是名为“polygon.shp”的多边形 shapefile。我想使用 cartopy 添加到 map
我是 cartopy 的新手,仍在学习基本功能。 我试图绘制一个特定的区域,但是,当我请求 80oN 时,cartopy 扩展了这个区域并生成了一个高达大约 85oN 的 map 。有没有办法确保我只
我正在尝试在北太平洋投影上绘制 250 hPa 位势高度、1000 hPa 可降水量和 250 hPa 风速。当尝试使用倒刺时,我没有收到错误,但倒刺并没有实际显示在 map 上。我认为这可能与我的数
我想用 180 在图的底部绘制北半球的极地立体图,以便我可以强调太平洋地区。我正在使用来自 git 的最新 cartopy,并且可以制作极坐标立体图没有问题,但我无法弄清楚如何更改图底部的经度。我尝试
我正在使用 matplotlib 和 Cartopy 从二维网格数据集生成图像。以下链接中的示例如下所示: 驱动此图像创建并将出现问题的关键代码如下: dataset = Dataset('/path
我想使用 Cartopy 仅绘制一个区域(在我的例子中,北美和南美)。 我目前正在使用以下代码: import cartopy import cartopy.crs as ccrs import ma
我正在尝试使用 Cartopy 在北极立体 map 投影上创建等高线图。我使用 add_cycular_point() 尝试解决经度 0 和经度 35X 之间存在间隙的问题,并按照文档 (always
我正在尝试使用 Cartopy 和 Anaconda Python 绘制 map 点,但在转换时遇到了一些奇怪的失败。在我的简单示例中,我试图绘制 3 个点,但它们正在加倍。 import matpl
如何在 Cartopy 中绘制美国县边界? 绘制州和国家边界非常简单 ax.add_feature(cfeature.BORDERS.with_scale('50m')) ax.add_feature
我正在尝试在 OSM 图 block 之上过度绘制一些卫星图像数据。 我可以分别绘制它们,但似乎不能过度绘制,我认为这取决于投影。 我加载数据并获取投影信息 ds = gdal.Open(fname)
我正在尝试使用 cartopy 绘制北极的轮廓。我已经使用了 add_circlic_point ,这已经成功地填充了 pcolormesh 中本初子午线的间隙,但是轮廓没有成功交叉,而是绕地球一圈进
我是一名优秀的程序员,十分优秀!