简体   繁体   中英

Problem with Backtrader after installing ibpy2

Backtrader worked fine for backtesting, but after installing:

pip install ibpy2

there would be an error:

在此处输入图像描述

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM