.. _Installation:
Installation for Python
================================================
Python Setup
-------------
1. If not already done, install a Python environment on your computer. For example, use the Python package and project manager `uv`:
- Install `uv` by following their `installation instructions `_.
- Install python with ``uv python install``.
- Create a python environment, e.g. with ``uv venv my-jcm-env``, and activate it.
2. Install the ``jcmoptimizer`` package into your local python environment.
- Depending on your python environment, run ``pip install jcmoptimizer`` or ``uv pip install jcmoptimizer``.
Using the Cloud Infrastructure
--------------------------------
The easiest and recommended way to use JCMoptimizer is to use our cloud infrastructure
to run servers and connect via a Python client. Here are the steps to get you going:
1. `Create a user account `_ on `https://optimizer.jcmwave.com `_.
Consider to add a `two-factor authentication `_ for increased security of your data.
2. Open the `cloud interface `_ and on the left
click on `Tokens `_.
3. Press `Add token+` to create a new access token.
4. Copy the token and store it somewhere safe on your computer.
You can put the token in the global configuration file of ``jcmoptimizer``.
That is, open or create the file ``.jcmoptimizer.conf.yml`` in your home directory and enter a line
.. code-block::
token:
Running a self-hosted JCMoptimizer
-----------------------------------
If you have a current license of our software package JCMsuite, you can run JCMoptimizer on your own computer infrastructure.
1. Download and run the JCMoptimizer installer from `here `_.
2. During the installation, you can create or update the configuration file ``.jcmoptimizer.conf.yml``
in your home directory. If you want to this manually, the following two keys need to be set:
:license_dir:
In order to run JCMoptimizer locally, an activated version of JCMsuite needs to be installed.
You need to specify the path to the license configuration of the JCMsuite isntallation,
for example
.. code-block::
license_dir: '/path/to/JCMsuite/license/'
:jcm_optimizer_dir: To start a JCMoptimizer server locally, the ``jcmoptimizer`` Python package needs to know
the installation directory ``jcm_optimizer_dir``:
.. code-block::
jcm_optimizer_dir: '/path/to/JCMoptimizer/'