Python IB API
Maintained. Last release 7 months ago.
pip install nautilus-ibapiInstallation Guide for TWS API Library
This guide provides step-by-step instructions for setting up the TWS API library, including creating virtual environments using both Anaconda and standard Python, building distributions, and testing the installation.
Please see Understanding Code Organization and Functionality section at the bottom for an explanation of the key terms, conventions, and code organization used.
Step 1: Clone the TWS API repository and set up a virtual environment:
- Open a terminal or Anaconda prompt on your Windows laptop.
- Change to the directory where you want to store the TWS API repository.
- Clone the TWS API repository from GitHub using git:
git clone https://github.com/your_username/tws-api.git
Replace your_username with your actual GitHub username.
Step 2: Create a new Python virtual environment (using Anaconda):
- First, ensure you are within the '\tws-api\source\pythonclient' folder inside the "tws-api" repository:
cd tws-api/source/pythonclient
- Create a new Python virtual environment using Anaconda:
conda create -n tws_env python=3.9
Replace tws_env with your desired environment name. Here, we are using Python 3.9 as an example, but you can choose another Python version if needed.
- Alternative: Create a new Python virtual environment without Anaconda:
python3 -m venv tws_env
Replace tws_env with your desired environment name.
Step 3: Activate the virtual environment:
- Activate the newly created virtual environment:
conda activate tws_env
- Alternative: Activate the virtual environment without Anaconda:
source tws_env/bin/activate
Step 4: Install the TWS API library:
- Build the source distribution:
python setup.py sdist
- Build the wheel distribution:
python setup.py bdist_wheel