Installation#

Author

Erik Inqwersen

Date

February 19, 2024

Using pip#

You can install peloptimize via pip:

$ pip install peloptimize

The command above installs the package in your local Python environment.

Development Mode#

Use the following commands to install the package in development mode:

  1. Clone the repository:

    $ git clone https://github.com/erik-ingwersen-ey/peloptimize.git
    

    > Note: this command assumes that you have git installed on your > machine, and that the git credentials are already configured.

  2. Go to the peloptimize directory (project’s root directory):

    $ cd peloptimize
    

    > Note: the path you need to specify when using the cd command > depends on where you cloned the repository to.

  3. Install the package in development mode:

    $ pip install -e .
    

    > Note: the -e flag stands for --editable. It tells pip to > install the package in development mode. > The development mode registers to your Python environment the project > modules located inside the src directory. > If you don’t install the package in development mode, all the > project modules are copied to your Python environment site-packages > folder. > This means that any changes that you make to the code won’t be reflected > in the version that got copied to site-packages and is used whenever you > write an import statement such as: from package_name import module_name.

Using setup.py#

> IMPORTANT: package installation via setup.py is deprecated. > Use it as a backup method in case the installation via pip fails.

You can install _Peloptimize_ via the file setup.py. To do so, execute the following command:

$ python setup.py install

Development Mode#

Use the following commands, to install the package in development mode, using setup.py:

$ python setup.py develop

Note that:

  • The installation via setup.py as shown above assumes that you have already cloned the repository, and that you’re in the root directory of the project.

Python Environment#

When installing the _Peloptimize_, it is recommended that you create a new Python environment for it.

If you’re using conda, you can create a new environment using the command:

$ conda create --name peloptimize python=3.8

The flag --name specifies the name of the environment. You don’t have to use the name peloptimize.

Then, to activate the environment, run the command:

$ conda activate peloptimize

Developer Notes#

This project is being build and maintained using poetry.