0

Backtrader worked fine for backtesting, but after installing:

pip install ibpy2

there would be an error:

enter image description here

This problem really annoy since it just appeared in one of my systems. I've uninstalled python and used anaconda, but the problem does not solve.

2 Answers2

0

I've tried every thing, at last I reinstated windows and it solved.

0

pip install wheel

I had a same problem. Based on your file named forex.py, I assume you are trying to follow these tutorials from:

In my case, I solved with pip install wheel in pipenv virtual environment.

Explanation:

  • What is the error: Because the IbPy2 is written in Python2 and it's not running on proper Python version. Please read this answer for detail. Python 2 and Python 3.

  • Why does it occur: When you create a virtual environment with pipenv, there is no wheel installed. Pipenv installs without wheel and the message is like this: Using legacy 'setup.py install' for IbPy2, since package 'wheel' is not installed. And then it was recognized as the code written in Python2.

  • How to solve: Install wheel first with pip install wheel. And then install IbPy2 with pip install IbPy2, then it will be properly installed and recognized as Python3 code. So you will not see the Python2 syntax error anymore.