I'm getting a new computer and am trying to set up my virtual environments the right way. In the past, I've just been using PyCharm and running everything through "C:\Python27\ArcGIS10.6" so it's a miracle I haven't broken ArcPy yet on my old computer.
I'm setting up virtual environments for:
- just ArcPy with ArcMap (so, Python 2.7); and
- Python 3.x for GDAL and other things
I'm following @CurtisPrice’s answer to Making separate Python installation that can call ArcPy? to set up virtual environments.
There is a simple example below, where I am writing and running a .py script in PyCharm.
Do I now just call @CurtisPrice's *.py file to set the virtual environment?
usercustomize.py ## is this how I set the virtual environment???
import arcpy
myshp = r'C:\Users\name\path\myfile.shp'
arcpy.AddField_management(myshp, "new_field", "SHORT")