Python 脚本依赖库安装指南 - 用于 ArcGIS 和 NetCDF 数据处理

以下 Python 代码中用到的库,需要您根据自己的环境进行安装:

# --- Import Modules --- #
import sys
sys.dont_write_bytecode = True                                                  # Do not write .pyc files
import os
import shutil
import time
import numpy
import arcpy
import netCDF4                                                                  # Packaged with ArcGIS 10.3 and higher
import re                                                                       # Added 10/11/2016 for string matching in netCDF global attributes
import importlib
import copy                                                                     # Added 11/19/2019 to allow copying of class objects
from distutils.version import LooseVersion

所需库安装命令:

  • numpy: pip install numpy
  • arcpy: ArcGIS 软件自带,无需额外安装
  • netCDF4: pip install netCDF4
  • re: Python 内置库,无需安装
  • importlib: Python 内置库,无需安装
  • copy: Python 内置库,无需安装

注意:

  • 如果您使用的是 ArcGIS 10.3 或更高版本,则已经安装了 arcpy 和 netCDF4 库。
  • 使用 pip 命令安装其他库即可。

原文地址: https://www.cveoy.top/t/topic/pijZ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录