qtpylib icon indicating copy to clipboard operation
qtpylib copied to clipboard

[BUG] No module named 'Queue' in ibpy2 dependency

Open dizzydes opened this issue 2 years ago • 2 comments

Describe the bug I'm getting a Queue vs queue capitalization error (more details here - it relates to a change in Python 2 vs 3) when trying to run the blotter file. It seems to stem from ibpy2 - is this where it should be gathering these libs from? Is there an alternative for this dependency or a workaround?

I've tried changing the capitalization in the file specified in the stack trace but it fires an exception for trying to print too many exceptions then! So I assume its bad...

Desktop (please complete the following information):

  • OS: Windows 10 (running from Powershell as Admin)

Additional context Stack trace:

PS C:\Users\desmo\Documents\sdata> python blotter.py
Traceback (most recent call last):
  File "C:\Users\desmo\Documents\sdata\blotter.py", line 2, in <module>
    from qtpylib.blotter import Blotter
  File "C:\Users\desmo\AppData\Local\Programs\Python\Python310\lib\site-packages\qtpylib-1.5.84-py3.10.egg\qtpylib\blotter.py", line 51, in <module>
    from ezibpy import (
  File "C:\Users\desmo\AppData\Local\Programs\Python\Python310\lib\site-packages\ezibpy-1.12.70-py3.10.egg\ezibpy\__init__.py", line 26, in <module>
  File "C:\Users\desmo\AppData\Local\Programs\Python\Python310\lib\site-packages\ezibpy-1.12.70-py3.10.egg\ezibpy\ezibpy.py", line 31, in <module>
  File "C:\Users\desmo\AppData\Local\Programs\Python\Python310\lib\site-packages\ibpy2-0.8.0-py3.10.egg\ib\opt\__init__.py", line 30, in <module>
    from ib.opt.connection import Connection
  File "C:\Users\desmo\AppData\Local\Programs\Python\Python310\lib\site-packages\ibpy2-0.8.0-py3.10.egg\ib\opt\connection.py", line 20, in <module>
    from ib.opt.dispatcher import Dispatcher
  File "C:\Users\desmo\AppData\Local\Programs\Python\Python310\lib\site-packages\ibpy2-0.8.0-py3.10.egg\ib\opt\dispatcher.py", line 8, in <module>
    from Queue import Queue, Empty
ModuleNotFoundError: No module named 'Queue'

dizzydes avatar Jan 28 '22 08:01 dizzydes

I install qtpylib following this comment https://github.com/ranaroussi/qtpylib/issues/141#issuecomment-1029021829, because the pip install seems not working now. However, using python setup.py install will mess up something if you do not specify the install path, especially when you have anaconda and python at the same time. I am not an expert in package installation and I hope someone can point out the main issue here.

I spent a few hours and solved the problems using brute force. Here is the solution:

  1. Find your package install location, e.g. C:\ProgramData\Anaconda3\Lib\site-packages
  2. Delete folder ib and folder IbPy2-0.8.0.dist-info
  3. Move ibpy2-0.8.0-py3.8.egg (Needs to be downloaded) to this directory
  4. Rerun python setup.py install

772435284 avatar Jul 31 '22 10:07 772435284

I install qtpylib following this comment #141 (comment), because the pip install seems not working now. However, using python setup.py install will mess up something if you do not specify the install path, especially when you have anaconda and python at the same time. I am not an expert in package installation and I hope someone can point out the main issue here.

I spent a few hours and solved the problems using brute force. Here is the solution:

  1. Find your package install location, e.g. C:\ProgramData\Anaconda3\Lib\site-packages
  2. Delete folder ib and folder IbPy2-0.8.0.dist-info
  3. Move ibpy2-0.8.0-py3.8.egg (Needs to be downloaded) to this directory
  4. Rerun python setup.py install

Where do I find ibpy2-0.8.0-py3.8.egg?

malikkurtz avatar Jun 18 '23 22:06 malikkurtz