问题
Hi I am trying to install ibapi in python however the package seems to be unavailable because there is an error every time I try to install it is there another way I can install this package . Your help will be greatly appreciated. I have left the code I used. to try and install the package
pip install ibapi
回答1:
The official Interactive Brokers API is only offered through their Github site and not the Python Package Index (PyPI) because its distributed under a different license. You can however build a wheel from the provided source code and then install the wheel. These are the steps:
1) Download "API Latest" from http://interactivebrokers.github.io/
2) Unzip or install (if its a .msi file) the download.
3) Go to tws-api/source/pythonclient/
4) Build a wheel with: python3 setup.py bdist_wheel
5) Install the wheel with:
python3 -m pip install --user --upgrade dist/ibapi-9.73.7-py3-none-any.whl
回答2:
Here a step by step setup instructions for Windows:
- Download and install TWS Gateway or Client
- Download and install Python to C:\Program Files\python... (and not the suggested ...\user\App... - gives you some more flexibility)
- Setup additional PATH environment variables (see pip warnings)
- Install wheel, i.e. type in the command line:
py -m pip install wheel
- Download "API Latest" (or latest version that contains python) from http://interactivebrokers.github.io/ and install into the folder X as proposed (but for python the directory shouldn't matter)
- Go to X/.../source/pythonclient/ (cd in command line)
- Build a wheel, i.e.
py setup.py bdist_wheel
- Look up the whl file in folder ./dist: should be something like
ibapi-9.7x.x..
- Install the wheel, i.e.
py -m pip install --user --upgrade dist/ibapi-9.73.7-py3-none-any.whl
回答3:
there is no pypi package called "ibapi"
if this is the one you are after : https://pypi.org/project/ibapi-grease/
then do
pip install ibapi-grease
or
https://pypi.org/project/ib-api/
pip install ib-api
回答4:
A pip search of the term ibapi only returns two packages.
ibapi-grease (0.2.0) - Monkey patches to grease the Interactive Brokers Python API
tws-async (0.5.7) - Use the Interactive Brokers API (IBAPI) asynchonously with asyncio or PyQt5
If you pip search for ib however, more Interactive Brokers related packages appear, which might be might you are looking for. Packages like:
ib-tools (0.1)
ib-wrapper (0.1.0)
ib (0.8.0)
ib-api (0.9.70)
ib-client (0.1.2)
ib-dl (1.5.3)
ib-insync (0.9.56)
ib-python (0.0.1)
ib-trading-calendars (0.1.2)
ibdb (0.0.0a4)
来源:https://stackoverflow.com/questions/57618117/installing-the-ibapi-package