BEST & OPERATIONAL: Same directory as your plot script
Example layout
gfs_maps/
├── gfs_precip_6hrly.py
├── precip_colormap.py
├── utils.py
└── run_gfs_maps.sh



Why this works

Python always searches the script’s directory first

No PYTHONPATH hacks

Works in cron / PBS / SLURM / ecFlow

Import
from precip_colormap import levels, colors
# or
from precip_colormap import precip_6hr


✔ Recommended for your GFS plotting system

✅ PROJECT PACKAGE (clean & scalable)

Best when you have many scripts.

Directory layout
gfs_maps/
├── plot/
│   ├── gfs_precip_6hrly.py
│   └── gfs_wind.py
├── colormaps/
│   ├── __init__.py
│   └── precip_colormap.py
└── utils/

Import
from colormaps.precip_colormap import precip_6hr

Required
touch colormaps/__init__.py


✔ Best long-term solution
✔ Very common in NOAA/NCEP codebases



--------------------------------------------------------
# placing external py files
--------------------------------------------------------
import sys
sys.path.insert(0, "/lfs/h1/ops/prod/python/colormaps")

from precip_colormap import precip_6hr
--------------------------------------------------------
