首页 > 编程语言 >[1052] Add the ArcPy Python interpreter in VS Code

[1052] Add the ArcPy Python interpreter in VS Code

时间:2024-08-29 08:57:36浏览次数:5  
标签:1052 Code Python Pro VS interpreter ArcPy

To add the ArcPy Python interpreter in Visual Studio Code (VS Code), follow these steps:

  1. Install ArcGIS Pro: Ensure you have ArcGIS Pro installed, as it includes the ArcPy library.

  2. Install VS Code: Download and install Visual Studio Code from the official website.

  3. Install the Python Extension: Open VS Code, click on the Extensions icon on the left sidebar, search for “Python,” and install the extension provided by Microsoft.

  4. Open Command Palette: Press Ctrl+Shift+P (or Cmd+Shift+P on macOS) to open the Command Palette.

  5. Select Interpreter: Type Python: Select Interpreter in the Command Palette and select it.

  6. Enter Interpreter Path: Choose Enter interpreter path and navigate to the ArcGIS Pro Python interpreter. The default path is usually:

    C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe
  7. Verify: You can verify the selected interpreter by checking the bottom-left corner of the VS Code window, where the current interpreter is displayed12.

This setup will allow you to use ArcPy within VS Code for your GIS workflows. If you encounter any issues, feel free to ask for more help!

标签:1052,Code,Python,Pro,VS,interpreter,ArcPy
From: https://www.cnblogs.com/alex-bn-lee/p/18385812

相关文章