Skip to content

Latest commit

 

History

History
120 lines (71 loc) · 3.76 KB

installation.md

File metadata and controls

120 lines (71 loc) · 3.76 KB

← BACK

OpenAD Installation


  • Quick install: For a simplified install without virtual environment, see Quick Install
  • Contributors: Skip to Installation for Development
  • Linux users: Check the Linux Notes
  • Poetry: If you prefer Poetry, you can run the setup wizard instead: poetry add openad


Installing on macOS / Linux

  1. Before you start
    Ensure you're running Python 3.10.10+ or 3.11. See instructions below.

    To see what version you are running:

    python -V
    

    Note: Due to an issue with one of our dependencies, Python 3.12 is not yet supported.

  2. Set up your virtual environment (recommended)

    python -m venv ~/ad-venv
    source ~/ad-venv/bin/activate
    

    Note: Use python3 on macOS. Note: To exit the virtual environment, you can run deactivate

  3. Install OpenAD

    pip install openad
    
  4. Continue to Getting Started



Installing on Windows

In order to run OpenAD on Windows 11, you will need to install the Ubuntu WSL package ("Windows Subsystem for Linux").

  1. Verify Windows version
    To check if you are running Windows 11 or later, press Win + R, type "winver", and press Enter. A window will open showing your Windows version.

  2. Verify WSL
    To check if you already have WSL installed, run wsl -l -v into the terminal. To see more information about your current version of Ubuntu, run lsb_release -a

  3. Install WSL
    Install WSL and create a user called 'openad' or one of your choosing.

    wsl --install Ubuntu-22.04
    

    Optional: To setup an Ubuntu Python environment from scratch, continue to Linux Notes

  4. Continue to Getting Started



Appendix

Upgrading Python

There's many ways to install or upgrade Python. We'll use pyenv.

  1. Install pyenv

    curl https://pyenv.run | bash
    
  2. Set up your shell environment for Pyenv
    Detailed instructions cam be found here. If you're using Zsh, you can run the commands below:

    echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
    echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
    echo 'eval "$(pyenv init -)"' >> ~/.zshrc
    
  3. Reboot your shell
    You can either open a new window or run:

    exec $SHELL
    
  4. Install Python Please note that OpenAD requires Python 3.10 or 3.11. Due to an issue with one of our dependencies, Python 3.12 is not yet supported.

     pyenv install 3.11
    
  5. Activate this version of Python If you wish to set this version as the default:

    pyenv global 3.11
    

    Alternatively, if you only wish to activate it in the current shell:

    pyenv shell 3.11
    

Linux Notes

If you wish to setup an Ubuntu Python environment from scratch, run:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11-full
sudo apt install python3-pip
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 100
sudo pip install pip --upgrade

You will need to restart your Linux session before running pip install openad so that the python libraries are in your path.

If you get an error when running init_magic, you may first need to setup the default iPython profile for magic commands.

ipython profile create