.. include:: .. _chapter_ide_integration: *************** IDE Integration *************** To use the MORe scripting API MORe can be integrated into an IDE. For the integration into any IDE, you will need to know the installation path of MORe. The path can be displayed as follows: * open a command prompt (type "cmd" in the windows start menu) * write "echo %MORE_INSTALLDIR" and press enter Spyder ====== Starting with MORe 5.1, Spyder is no longer installed into the MORe environment by default. In order to continue using Spyder, Spyder standalone has to be installed. Installation ------------ Download the installer from https://www.spyder-ide.org and follow the instructions of the installer. Integrate MORe -------------- #. Start Spyder from the Start Menu #. Go to Tools |rarr| Preferences |rarr| Python interpreter #. Select "Use the following python interpreter", click the select file icon, paste "%MORE_INSTALLDIR%\\env\\python.exe" to the filename and click ok. Alternatively you can also browse to "MORe installation directory"\\env\\python.exe. .. image:: media/Spyder_configure_interpreter.png :alt: python interpreter selection :scale: 40 % #. Restart the console by clicking the cross next to "Console 1/A" #. Click on open file, the paste "%MORE_INSTALLDIR%\\python\\MORe.ipy" to the filename field. Alternatively browse to "MORe installation directory"\\python\\MORe.ipy. Make sure to allow the opening of .ipy files in the file dialog. .. image:: media/Spyder_file_open_dialog.png :alt: python file open dialog :scale: 40 % #. Run the startup script. .. image:: media/Spyder_run_script.png :alt: python file open dialog :scale: 40 % #. When running the first time, a popup asking for "Run settings" will appear. Chose "Run file with default configuration" PyCharm ======= Installation ------------ Download PyCharm Community (make sure to scroll down and download the Community Editon. Do not download the Professional Edition, unless you have a license for it) from https://www.jetbrains.com/pycharm/download/ and follow the instructions of the installer. Integrate MORe -------------- #. Start PyCharm from the Start Menu #. Select "open project" #. In the dialog browse to "MORe installation directory"\\python. If the installation directory is in AppData, you might need to enable "show hidden files" in the dialog menu bar. .. image:: media/pycharm_open_project.png :alt: pycharm open project :scale: 40 % #. If a popup appears, select "Trust Project". #. Open Settings |rarr| Project: python |rarr| Python Interpreter. Then select "Add interpreter" |rarr| Add Local Interpreter .. image:: media/pycharm_select_interpreter.png :alt: pycharm select interpreter :scale: 40 % #. Chose "System interpreter" and browse to the python executable in "MORe installation directory"\\env\\python.exe. .. image:: media/pycharm_add_system_interpreter.png :alt: pycharm add system interpreter :scale: 40 % #. As of 11.01.2024, PyCharm versions 2023.3 and newer produce this error message, which is of no consequence. .. image:: media/pycharm_packages_not_loading.png :alt: pycharm packages not loading :scale: 40 % Afterwards an error popup will show up. Confirm the error with OK and continue with the next step. .. image:: media/pycharm_interpreter_error.png :alt: pycharm interpreter error :scale: 40 % #. From the run configuration drop down select "Edit Configurations". Then add a new python configuration. Modify the following parameters: * Name: MORe * Python interpreter dropdown: Make sure the environment from the "MORe installation directory"\\env is selected. * Script path: select MORe_pycharm.py from "MORe installation directory"\\python. * Working directory: select "MORe installation directory"\\python * From the "modify options" dropdown, select "Run with Python console" .. image:: media/pycharm_add_run_configuration.png :alt: pycharm add run configuration :scale: 40 %