I have installed gdal through anaconda. When I run a subprocess in Python before importing gdal I can get that gdal tools are located in my conda environment. For example subprocess.run(['which', 'gdal_rasterize']) would show /path/to/env/bin//gdal_rasterize
This is good because whenever I run gdal_rasterize within a subprocess it runs within the environment, however as soon as I import gdal into my Python interpreter or script (which I use gdal for other uses) whenever I run the same subprocess.run(['which' , 'gdal_rasterize']) I now get /usr/bin/gdal_rasterize
In fact importing gdal also changes the path to which version of Python I'm using in the environment. subprocess.run(['which', 'python']) changes to /usr/bin/python
This all wouldn't be an issue but I'm working on a server with tools that are less up to date than the conda environment and certain gdal functions have different parameters. Just trying to figure out why the environment would be changed for some reason.
Does anyone have any ideas?
I am on Linux (CentOS 6.6)