Setup python, QT, PyQT and MinGW on my XP box using instructions in:
http://iwiwdsmi.blogspot.com/2007/01/how-to-install-pyqt-41-python-25-and-qt_8340.html
Downloaded and successfully executed setup.py for ibpy.
Checked out the profitpy sources via svn.
Executed a successful make from the profit directory.
Successfully ran examples/ui_accountsummary.py, thinking the examples
dir must have a toy application and seeing this .py was created by
make and has a main(). (Troy tells me this isn't supposed to be
executed). Anyway, it runs, bringing up an empty window with a select
button, so at least all the QT stuff seems okay.
Now I'm a bit at a loss, though. I have TWS running with the socket
API enabled and 127.0.0.1 as a trusted IP, using port 7496. I looked
in the profit/bin directory and saw two likely python sources having
main(), so I tried executing hist_downloader. It first complained:
ImportError: No module named profit.lib.core
As I said, I'm still sopping wet behind my python ears, so I didn't
know any obviously "correct" ways to resolve this and just inserted
the line:
sys.path.append('S:\\cygwin\\home\\Greg\\ibpy\\profitpy')
immediately before the "from profit.lib.core import Signals" line in
hist_downloader. This seemed to allow that particular import to
succeed, but now it complains:
Traceback (most recent call last):
File "S:\cygwin\home\Greg\ibpy\profitpy\profit\bin\hist_downloader",
line 25, in <module>
from profit.session import Session, SessionBuilder, Ticker, Order,
Contract, Series, DataCollection
File "S:\cygwin\home\Greg\ibpy\profitpy\profit\session\__init__.py",
line 25, in <module>
from profit.series import Series, MACDHistogram, EMA, KAMA
ImportError: cannot import name EMA
And I'm now stumped. A grep turns up the EMA class in series/
advanced.py, and series/__init__.py does a:
try:
from profit.series.advanced import *
except (ImportError, ):
pass
which looks to my n00b eye as though it should at least be trying to
import everything from advanced.py.
Any tips? Should I have set up profitpy so that the modules are
available in the sys.path? If so, how? And why is the profit.series
import failing on EMA?
> Successfully ran examples/ui_accountsummary.py, thinking the examples
> dir must have a toy application and seeing this .py was created by
> make and has a main(). (Troy tells me this isn't supposed to be
> executed). Anyway, it runs, bringing up an empty window with a select
> button, so at least all the QT stuff seems okay.
The ui_*.py files are generated by pyuic4 from the ui_*.ui files. They all
should be executable, but I don't make any claims that they'll work by
themselves.
> Now I'm a bit at a loss, though. I have TWS running with the socket
> API enabled and 127.0.0.1 as a trusted IP, using port 7496. I looked
> in the profit/bin directory and saw two likely python sources having
> main(), so I tried executing hist_downloader. It first complained:
> ImportError: No module named profit.lib.core
try this:
$ python bin\profit_device
> As I said, I'm still sopping wet behind my python ears, so I didn't
> know any obviously "correct" ways to resolve this and just inserted
> the line:
> sys.path.append('S:\\cygwin\\home\\Greg\\ibpy\\profitpy')
You can append the path to the environment variable PYTHON_PATH, or you can
set that variable in your shell to point to the location
> immediately before the "from profit.lib.core import Signals" line in
> hist_downloader. This seemed to allow that particular import to
> succeed, but now it complains:
>
> Traceback (most recent call last):
> File "S:\cygwin\home\Greg\ibpy\profitpy\profit\bin\hist_downloader",
> line 25, in <module>
> from profit.session import Session, SessionBuilder, Ticker, Order,
> Contract, Series, DataCollection
> File "S:\cygwin\home\Greg\ibpy\profitpy\profit\session\__init__.py",
> line 25, in <module>
> from profit.series import Series, MACDHistogram, EMA, KAMA
> ImportError: cannot import name EMA
>
> And I'm now stumped. A grep turns up the EMA class in series/
> advanced.py, and series/__init__.py does a:
The problem is that the code isn't yet complete. The best workaround for now
is to download and install SciPy. (I did fix this in r234, so you should be
able to get this working by either "svn up && make" or by installing SciPy.)
> which looks to my n00b eye as though it should at least be trying to
> import everything from advanced.py.
>
> Any tips? Should I have set up profitpy so that the modules are
> available in the sys.path? If so, how? And why is the profit.series
> import failing on EMA?
ProfitPy shouldn't be in site-packages (not yet). For now, set PYTHON_PATH to
your checkout directory.