The pycharm compiler is changed to the python2.7 that comes with arcgis-------two ways
1. When creating a new project, select the existing compiler as python2.7
2. When creating a new project, create a new environment, select the compiler as python2.7, and be sure to check Inherit global site-package. Otherwise the arcpy package cannot be imported into the new environment.