issue with ib and profit

27 views
Skip to first unread message

CR

unread,
Dec 4, 2008, 12:06:33 AM12/4/08
to ProfitPy Discuss
Possible issue with compatibility of new version of ib?

Any thought are greatly appreciated.

Thank you.


Traceback (most recent call last):
File "./bin/profit_workbench", line 13, in <module>
from profit.workbench.main import ProfitWorkbenchWindow
File "/Library/Python/2.5/site-packages/profit/workbench/main.py",
line 30, in <module>
from profit.lib.widgets.propertyeditor import PropertyEditor
File "/Library/Python/2.5/site-packages/profit/lib/widgets/
propertyeditor.py", line 10, in <module>
from ib.opt.message import messageTypeNames
ImportError: cannot import name messageTypeNames


Type "help", "copyright", "credits" or "license" for more information.
>>> import ib
>>> import ib.opt.message
>>> from ib.opt.message import messageTypeNames
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name messageTypeNames
>>>


Troy Melhase

unread,
Dec 4, 2008, 12:23:43 AM12/4/08
to profitpy...@googlegroups.com
>>>> import ib
>>>> import ib.opt.message
>>>> from ib.opt.message import messageTypeNames
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ImportError: cannot import name messageTypeNames

If you're using ProfitPy from SVN, you also need to get IbPy from SVN.

troy

Thor

unread,
Dec 18, 2008, 7:59:20 PM12/18/08
to ProfitPy Discuss
I am also having this issue with messageTypeNames.

installed first ibpy and then profitpy by svn.

this is certainly a python newbie problem

I can successfully:
>>> from ib.opt.message import messageTypeNames
but only when I am in the ibpy folder.

I have tried exporting PYTHONPATH's appropriately but with no
success.

Any hints?

Troy Melhase

unread,
Dec 18, 2008, 8:10:25 PM12/18/08
to profitpy...@googlegroups.com
> Any hints?

Sure.

1. move out of the "ibpy folder", start python, and try the import again.
2. what is the exact PYTHONPATH setting? it should be something like
"export PYTHONPATH=/home/thor/code/ibpy/trunk" -- notice the lack of
a trailing "/ib"
3. verify that the python that imports ib is the same python that you
use to start profitpy
4. check the sys.path directories for other copies of ibpy; perhaps
you have an older release tucked away in
/usr/lib/python2.x/site-packages/

From what you describe, my bet is #2. HTH,

And FWIW, I've finally got API version 9.51 working with python 2.6,
so there's a new release around the corner...


troy

Thor

unread,
Dec 18, 2008, 8:32:47 PM12/18/08
to ProfitPy Discuss
Thanks Troy,

I guess the problem was that I had been using the python setup.py
install path which created conflicting eggs. After deleting those and
setting the PYTHONPATH=/.../ipby/trunk/:/.../profitpy/trunk/ then ./
bin/profit_workbench successfully starting profitpy. Although there
was some errors.

2008-12-18 20:22:59,142 DEBUG Session set for to <Session 0xdc2780
messages:0 connected:False>
2008-12-18 20:22:59,144 DEBUG Exception valueLoad: , EOFError()
2008-12-18 20:22:59,145 DEBUG Session set for centralTabs to <Session
0xdc2780 messages:0 connected:False>
2008-12-18 20:22:59,145 DEBUG Session set for SessionTree to <Session
0xdc2780 messages:0 connected:False>
2008-12-18 20:22:59,534 DEBUG Exception valueLoad: , EOFError()

These didn't stop the app from opening. And also, I am using python
2.6...

When I get comfortable with the code base I will ask more questions,
and hopefully contribute some backtesting code. I have some monte-
carlo routines in python which generate various market conditions and
could be used for stress testing trading ideas.

Thanks again,
Joel

Troy Melhase

unread,
Dec 18, 2008, 9:24:49 PM12/18/08
to profitpy...@googlegroups.com
> 2008-12-18 20:22:59,144 DEBUG Exception valueLoad: , EOFError()
> 2008-12-18 20:22:59,534 DEBUG Exception valueLoad: , EOFError()

These are from a missing settings file. It should only happen once.
The other output is entirely normal.

> These didn't stop the app from opening. And also, I am using python
> 2.6...

Hm. The code in ibpy svn doesn't work 100% with python2.6. As I said
earlier, that will be fixed Real Soon.

> When I get comfortable with the code base I will ask more questions,
> and hopefully contribute some backtesting code. I have some monte-
> carlo routines in python which generate various market conditions and
> could be used for stress testing trading ideas.

I'm happy to answer any and all questions. And patches are always welcome!

Regarding your monte-carlo routines, do you envision a GUI for
configuring and/or testing? That's the direction I've started down
with the neural network designer, and in general, is the direction for
the package.

> Thanks again,

You're very welcome. Please keep us posted on your progress.

troy

Reply all
Reply to author
Forward
0 new messages