
# OpenCAPIF SDK development environment installation

Before installation it's needed to have completed the [requirements](../README.md) section.

Follow next steps to perform OpenCAPIF SDK installation:

- For developers installation is mandatory to have already installed:
    - pyenv

1. Create an environment with pyenv

```console
#Commands to install the Python environment
pyenv install 3.12
pyenv virtualenv 3.12 pesp_sdk_env
#Activate your environment
source your/path/to/.pyenv/versions/pesp_sdk_env/bin/activate
```

OPTIONAL step: sometimes Apple Mac shells raise issues while finding the shell path. If this happens, try this command:

    ```console
    export PATH="$HOME/.pyenv/bin:$PATH"
    eval "$(pyenv init --path)"
    eval "$(pyenv init -)"
    eval "$(pyenv virtualenv-init -)"
    ```
OPTIONAL step: For Arm64 architecture sometimes will appear this problem 

    ```Last 10 log lines:
        __locale_localeconv in _localemodule.o
        __locale_localeconv in _localemodule.o
        __locale_localeconv in _localemodule.o
        __locale_localeconv in _localemodule.o
    "_libintl_textdomain", referenced from:
        __locale_textdomain in _localemodule.o
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [Programs/_freeze_module] Error 1
    make: *** Waiting for unfinished jobs....´´´


This article explains how to solve it [here](https://laict.medium.com/install-python-on-macos-11-m1-apple-silicon-using-pyenv-12e0729427a9)  




2. Clone GitHub repository:

```console
git clone -b sdk_v0.1 --single-branch https://github.com/Telefonica/pesp_capif_sdk.git
```

```console
#Then move to the pesp_capif_sdk folder

cd /your/path/to/pesp_capif_sdk
```

3. Install the Python requirements listed in requirements.txt file:

```console
cd installation

python -m pip install --upgrade pip

pip install -r requirements.txt
```

**Congratulations!** You have finalized the installation of OpenCAPIF SDK.