I have a substantial amount of code that I need to run through ArcGIS Pro. Due to the length, I decided to switch to an IDE that has a good debugger and I installed PyCharm 2021.1.1. I have not had any success running any geoprocessing commands as I always get "RuntimeError: Object: Error in executing tool" and/or "python-BaseException" errors. I wrote a simple code to create a buffer around a polygon feature class and it has the same errors (I presume once I get this code fixed, my longer code will also work). Does anyone know what I can change to get this to work?
I have ArcGIS Pro 2.8 and the commands run just fine there. I have the same python interpreter set in both ArcGIS and PyCharm (it is a clone of the default with a couple packages added). I leave ArcGIS Pro open while I run the code so it will automatically load the license (which I have checked and it does that properly). I know my shapefile reader is also working (at least I can pull values off my shapefiles just fine). I also get an error code that the mkl-service package is not importing correctly; I don't know if that is the problem but I haven't been able to figure it out. I've uninstalled and reinstalled the mkl-service package and restarted both PyCharm and ArcGIS Pro. I'm pretty new to Python and not confident on the import statements; I know I don't need all of them for this code but I think I need them all for pieces of my bigger code so they are all included here.
My code (Temp.py):
from datetime import date
from datetime import time
from datetime import datetime
import array as arr
import arcpy
from arcpy import env
from arcpy import analysis
arcpy.CheckOutExtension("Spatial")
import shapefile
import numpy
import csv
import sys
ThisFolder = "D:\\LHD_GIS\\ResearchAttempt5Python\\"
in_raster = 'D:\\LHD_GIS\\ResearchAttempt5Python\\ImagesForMyCode\\Extract Bands_Gr5_12E.tif' ### will change
in_class_data = shapefile.Reader(ThisFolder + "LHD_Poly_all_TileName") ### may change
in_no_dams = shapefile.Reader(ThisFolder + "NotDams")
arcpy.analysis.Buffer(in_no_dams, 'D:\\LHD_GIS\\ResearchAttempt4\\ResearchAttempt4.gdb\\NotDams_Buffer2', "10 Feet", "FULL", "ROUND", "NONE", None, "PLANAR")
#This is the command I will need to use eventually:
#arcpy.ia.ExportTrainingDataForDeepLearning('D:\\LHD_GIS\\ResearchAttempt5Python\\ImagesForMyCode\\Extract Bands_group308.tif', "D:\\LHD_GIS\\ResearchAttempt4\\TestExports\\NonDam_May20_3", in_class_data, "TIFF", 1024, 1024, 512, 512, "ONLY_TILES_WITH_FEATURES", "PASCAL_VOC_rectangles", 0, "Classvalue", 0, None, 0, "MAP_SPACE", "PROCESS_AS_MOSAICKED_IMAGE", "NO_BLACKEN", "FIXED_SIZE", None)
print("We did it")
Message when I run the code:

Message after I run the debugger:

that top line of code that gets cut off in both images says: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service