Path variables
Use path variables to define absolute paths to resources that are not part of a specific project. These external resources may be located in different places on the computers of your teammates. This is why user-defined custom path variables are not stored as project settings, but as global IDE settings. Once configured, such path variables will have the same value for any project that you open with your instance of PyCharm.
Create a new path variable
- Press Control+Alt+S to open the IDE settings and then select Appearance & Behavior | Path Variables .
- Click , enter the name and value of the variable, and click OK to apply the changes.
You can use path variables to specify paths and command-line arguments for external tools and in some run configurations.
For example, you can define a path variable that points to the location of some data source (like a CSV file) or a third-party library that is not stored in your project. If you use this path variable in a run configuration that you share with your project, others can define the correct value for this path variable in their environment and be sure that the run configuration will work for them.
Refer to the variable as $var_name$ in fields and configuration files that accept path variables.
PyCharm also has the following built-in path variables:
The current user’s home directory.
The current project’s root directory.
Create a new path variable
For example, you have a Python script that processes some data stored in your system in the reports.csv file. You create a run/debug configuration to run this script and want to share this configuration with your teammates through the VCS.
- Press Control+Alt+S to open the IDE settings and then select Appearance & Behavior | Path Variables .
- Click and enter the name of the new variable (for example, DATA_PATH ) and its value that points to the target directory with the data file on your disk.
- Share the run/debug configuration through your version control system.

- Inspect the .idea/runConfiguration/.xml file:
After your teammates update their projects from VCS, they will change the DATA_PATH variable value so that it points to the data directory on their computers.
Ignore path variables
Whenever you open or update a project, PyCharm checks for unresolved path variables. If the IDE detects any, it will ask you to define values for them. If you are not going to use files or directories with the unresolved path variables, you can add them to the list of ignored variables.
You can also use the list of ignored variables when a program argument passed to the run/debug configuration has the same format as a path variable (for example, an environment variable).
- Press Control+Alt+S to open the IDE settings and then select Appearance & Behavior | Path Variables .
- Add the names that PyCharm shouldn’t consider to be path variables to the Ignored Variables field.
- Click OK to apply the changes.
Path Variables
Revert path variables and the list of ignored variables to their initially saved states.
This field shows the name of a path variable (readonly).
This field shows the value of a path variable (readonly).
Create a new path variable.
Edit the selected path variable.
Delete the selected path variable.
List the names of the variables that should be ignored. Use semicolons ; to separate the list items.
Add / Edit Variable dialog
Specify the path variable name.
Specify the path variable value. Use Shift+Enter to select the necessary file or folder in the Select Path dialog .
Example: creating a new path variable
You may have a library that is located outside your project directory. This library is attached to your project, and the path to this library is included in the .iml file of your project. However, this path should not be absolute, because the location on this library may be different on your teammates’ computers. In this case, you can create the PATH_TO_LIB variable:
- Press Control+Alt+S to open the IDE settings and then select Appearance & Behavior | Path Variables .
- Click .
- In the Add Variable dialog, type the PATH_TO_LIB variable, and its value that points to the library location on your disk.
- Share the .iml file through your version control system.
- After your teammates update their projects from VCS, they will change the PATH_TO_LIB variable value so that it points to the library location on their computers.
Path variables
Use path variables to define absolute paths to resources that are not part of a specific project. These external resources may be located in different places on the computers of your teammates. This is why user-defined custom path variables are not stored as project settings, but as global IDE settings. Once configured, such path variables will have the same value for any project that you open with your instance of IntelliJ IDEA.
Create a new path variable

- Press Control+Alt+S to open the IDE settings and then select Appearance & Behavior | Path Variables .
- Click , enter the name and value of the variable, and click OK to apply the changes.
You can use path variables to specify paths and command-line arguments for external tools and in some run configurations. For more information, refer to Built-in IDE macros.
For example, you can define a path variable that points to the location of some data source (like a CSV file) or a third-party library that is not stored in your project. If you use this path variable in a run configuration that you share with your project, others can define the correct value for this path variable in their environment and be sure that the run configuration will work for them.
Refer to the variable as $var_name$ in fields and configuration files that accept path variables.
IntelliJ IDEA also has the following built-in path variables:
The current user’s home directory.
The current project’s root directory.
The current module’s root directory.
The directory with the current module’s .iml file.
Ignore path variables
Whenever you open or update a project, IntelliJ IDEA checks for unresolved path variables. If the IDE detects any, it will ask you to define values for them. If you are not going to use files or directories with the unresolved path variables, you can add them to the list of ignored variables.
You can also use the list of ignored variables when a program argument passed to the run/debug configuration has the same format as a path variable (for example, an environment variable).
- Press Control+Alt+S to open the IDE settings and then select Appearance & Behavior | Path Variables .
- Add the names that IntelliJ IDEA shouldn’t consider to be path variables to the Ignored Variables field.
- Click OK to apply the changes.
Pycharm settings error «Environment location directory is not empty»
I am trying to import arcpy into a script in PyCharm 2021.1. I do not have access to ArcGIS Pro, so I used the advice on this page to clone python 3.7 in Anaconda. I am trying to change the PyCharm python location setting to this clone, but getting this error message in the Virtual Environment setting, «»Environment location directory is not empty.»
I switched to Conda Environment and it allowed the location, and I hit OK to apply it, but then got this error message, «. can’t create; no such file or directory.»
How can I get PyCharm to work with ArcPy without ArcGIS Pro?
64.9k 29 29 gold badges 108 108 silver badges 333 333 bronze badges
asked Aug 17, 2021 at 14:54
23 1 1 gold badge 1 1 silver badge 8 8 bronze badges
2 Answers 2
arcpy requires ArcGIS Pro and cannot be used without a full ArcGIS Pro install.
However, you can install and use the the ArcGIS API for Python as per the documentation you linked to, but note that this is not arcpy . The API will have some additional functionality if arcpy is installed, but it is not required.
You’re trying to create a virtualenv, but you have already created (by cloning) a conda env. A virtualenv is very different to a conda env. So:
- select the «Conda Environment», not the «Virtualenv Environment» radio button and
- Once you’ve selected «Conda Environment», select «Existing environment» not «New environment» as you’ve already created the environment outside of PyCharm.
- Finally, you can install the ArcGIS API for Python.
answered Sep 13, 2021 at 2:07
64.7k 6 6 gold badges 110 110 silver badges 191 191 bronze badges
Delete venv folder and try to add the interpreter again. It will solve the error.
