alex_bn_lee

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

[934] Run the python file directly (ArcGIS Pro)

ref: The Edit with IDLE and Run with ArcGIS Pro options are not available in the context menu when right-clicking Python files


Description

In some instances, when right-clicking Python files, the 'Edit with IDLE' and 'Run with ArcGIS Pro' options are not available in the context menu.

Image of the the Edit with IDLE and Run with ArcGIS Pro options are not available in the context menu

Cause

The following are the possible causes:

  • The default app to open the Python files has changed.
  • The registry keys are not available.

Solution or Workaround

Select one of the options below depending on the cause to resolve the issue.

Select python.exe as the default application to open Python files

  1. Right-click the Python file, and select Properties.
  2. In the Properties window, click the General tab, and click the Change button next to Opens with:.
  3. In the Open with window, click the Browse button.
  4. In the Open with… window, paste the following path in the address bar, and press Enter.
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
  1. Select python.exe, and click Open.
Image of the Open with... window
  1. Close the Properties window.

Add the registry keys

Warning:
The instructions below include making changes to essential parts of the operating system. Esri recommends performing a backup of the operating system and files, including the registry, before proceeding. Esri cannot guarantee results from incorrect modifications while following these instructions. Exercise caution. Consult a qualified computer system professional if necessary.
Note:
Replace Python27 and ArcGIS10.7 with the appropriate versions if needed.
  1. Open a text editor such as Notepad, and copy the following command to the text editor:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Python.File\shell\Edit with IDLE\command]
@="\"C:\\Python27\\ArcGIS10.7\\pythonw.exe\" \"C:\\Python27\\ArcGIS10.7\\Lib\\idlelib\\idle.pyw\" -e \"%1\""
[HKEY_CLASSES_ROOT\Python.NoConFile\shell\Edit with IDLE\command]
@="\"C:\\Python27\\ArcGIS10.7\\pythonw.exe\" \"C:\\Python27\\ArcGIS10.7\\Lib\\idlelib\\idle.pyw\" -e \"%1\""
  1. Save the file as a .reg file in the Python folder. In this example, the file is saved in the Python27 folder. By default, the location is as follows:
C:\Python27
  1. Right-click the .reg file, and click Merge. Proceed to click Yes when prompted.

The following image displays the availability of Edit with IDLEEdit with IDLE (ArcGIS Pro), and Run with ArcGIS Pro options in the context menu.

Image of the Edit with IDLE and Run with ArcGIS Pro options are available in the context menu

 

posted on   McDelfino  阅读(12)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2015-11-03 【173】双显示器随便切换位置
点击右上角即可分享
微信分享提示