ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

为 ArcGIS Server 部署自定义 Python 包

  • 为从 ArcGIS Desktop 发布的服务测试自定义 Python 软件包

ArcGIS Server 包括适用于 64 位 Windows 的 Python 2.7。在 ArcGIS Enterprise 10.5 及更高版本中,基于 Python 3 的 conda 环境包含在 ArcGIS Server 中。

ArcGIS Server 的 Python 安装还包括其他包,如 numpy 和 matplotlib。但是,如果您希望安装其他自定义 Python 包,请按照以下步骤操作。

为从 ArcGIS Desktop 发布的服务测试自定义 Python 软件包

要测试是否正确安装了包文件,请编写导入安装的包的 Python 脚本,然后运行脚本。如果不熟悉如何运行独立脚本,请按照以下步骤操作。

  1. 打开终端窗口。
  2. 以脚本作为参数运行服务器的 Python 2.7,例如:<ArcGISServer_InstallDir>/arcgis/server/tools/python ~/projectX/mytestscript.py

注:

在 ArcGIS Server (Linux) 安装过程中安装的 Python 库是适用于 64 位 Windows 的 Python。因此,访问数据和其他 Python 模型时,您应在独立 Python 脚本中始终使用 Windows 路径分隔符 (\)。此外,还应注意 Z:\ 目录映射到 Linux 系统的 /。在 Python 脚本中,可以使用 Z:\ 映射访问数据和其他 Python 模型。例如,可以通过 z:\myuser\myproject\data 访问 /myuser/myproject/data 中的数据。

这不适用于通过 ArcGIS Desktop 发布的 Python 脚本,因为会在发布过程中将所有路径转换为正确的格式。

相关主题

  • ArcPy 基本词汇

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2021 Esri. | 隐私政策 | 法律声明