Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Cannot install from PYPI server #171

Open
thesupershan opened this issue Jun 9, 2021 · 3 comments
Open

Cannot install from PYPI server #171

thesupershan opened this issue Jun 9, 2021 · 3 comments
Labels

Comments

@thesupershan
Copy link

thesupershan commented Jun 9, 2021

Describe the bug
Cannot install with python 3.8.2

To Reproduce
Steps to reproduce the behavior:

  1. pip install qtpylib --upgrade --no-cache-dir

Desktop (please complete the following information):

  • OS: macOS, 11.2.1
  • python: 3.8.2

Additional Info
It does install locally when cloned.

@thesupershan thesupershan changed the title [BUG] Cannot install from PYPI server Jun 9, 2021
@htpeter
Copy link

htpeter commented Jun 15, 2021

Hi @thesupershan, I too ran into this issue recently when trying to install via pip. My suggested solution, which it sounds like you have stumbled upon, is cloning and installing locally via python setup.py install. Feels safe to assume there may not be a fix pushed for this so you'll have to find a more permanent workaround in your own workflow. The maintainer is busy building other great software for us :).

More Info About the Error:
The pip installation error seems to be an existing issue that must be worked around. The cause is due to an unexpected value for the package_data in setup.py. The below thread includes individuals discussing it a bit more detail if curious.

#141 (comment)

@datatalking
Copy link

@htpeter Once you did that. Instruction #1 says to create blotter.py.

The blotter script is the same one located in qtpylib/examples/blotter.py
Did you just cd examples then run blotter from there?

@htpeter
Copy link

htpeter commented Aug 6, 2021

@datatalking I wrote my own blotter.py script but its essentially the same as the examples file.

Blotter defaults to using Interactive Broker's TWS/Gateway so you'll need that up and running first. I also believe it may require MySQL be running locally.

The Blotter class has the following arguments and default values (I just copy pasted these below from the library's code).
I include this list so that you can make sure your IBKR TWS/Gateway is available on the expected Port and expected Client ID (you just have to make these values match between the API Settings in TWS and the Python code).

# Arguments you can include when instantiating `Blotter()` to make it work with TWS.
bport=4001, 
ibclient=999, 
ibserver="localhost",
# Arguments you can include when instantiating `Blotter()` to make it work with MySQL
dbhost="localhost", 
dbport="3306",
dbname="qtpy",
dbuser="root", 
dbpass="", 

And just for reference, here is the most basic version of blotter.py with some of the details I listed above explicitly added. Once everything is running, just run python blotter.py. If you run into errors related to IBKR connection or MySQL, double check those other pieces of software are configured as expected.

# blotter.py
from qtpylib.blotter import Blotter

class MainBlotter(Blotter):
    pass # we just need the name

if __name__ == "__main__":
    blotter = MainBlotter(
              bport=4001, 
              ibclient=999, 
              ibserver="localhost",
              dbhost="localhost", 
              dbport="3306",
              dbname="qtpy",
              dbuser="root", 
              dbpass="", 
    )
    blotter.run()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants