Install Cartopy with Conda
Installation code:
conda install -c conda-forge cartopy
During the installation process, I encountered this problem: python cannot locate the program input point in the dynamic link library pythoncom37
After consulting the information on the Internet
- The first reason: The environment you are using has not updated the conda
code as follows:
conda update -n base conda # 基环境
conda update -n [你的环境名称] conda # 其他虚拟环境
After the change, it was found to be incorrect, and this problem still occurs
- The second reason: pythoncom37.dll duplicate
pythoncom37.dll originally appeared inE:\Anaconda3\envs\O3\Library\bin\
this folder,
but itE:\Anaconda3\envs\O3\Lib\site-packages\pywin32_system32\
also exists in this folder
Solution : deleteE:\Anaconda3\envs\O3\Lib\site-packages\pywin32_system32\
this folder,pythoncom37.dll
reinstall, andCartopy
test, the code is as follows:
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
ax = plt.axes(projection=ccrs.PlateCarree())
ax.coastlines()
# Save the plot by calling plt.savefig() BEFORE plt.show()
plt.savefig('coastlines.pdf')
plt.savefig('coastlines.png')
plt.show()
I found that I still can't run Cartopy
the problem successfully : I updated cartopyTypeError: wrapper() got an unexpected keyword argument
in ANACONDA NAVIGATOR, re-run the code, and got the result!