areed1192 / interactive-brokers-api

A python application used to interact with the Interactive Brokers REST API.
MIT License
92 stars 44 forks source link

Auth and such are using subprocesses that invoke `cmd` and `tasklist`, so windows only. #2

Open automata-studio opened 2 years ago

automata-studio commented 2 years ago

Are there no options to use this library on mac / UNIX? Or do I have to change all the subprocess windows commands to UNIX equivalents?

e.g. FileNotFoundError: [Errno 2] No such file or directory: 'tasklist' when trying to see if there is an active running gateway...

Kind regards, Kristof

automata-studio commented 2 years ago

If you want I extend this on another branch and open a PR for you....

maxwhoppa commented 2 years ago

Also running into this issue, would love that pr

Cass0wary commented 2 years ago

Hi @areed1192 I just hit this issue, should this work with osx?

J$ python3 test.py 
Traceback (most recent call last):
  File "/Users/username/Documents/python/ibkr/interactive-brokers-api/test.py", line 29, in <module>
    auth_service.login()
  File "/Users/username/Documents/python/ibkr/interactive-brokers-api/ibc/utils/auth.py", line 47, in login
    is_running_response = self._is_already_running()
  File "/Users/username/Documents/python/ibkr/interactive-brokers-api/ibc/utils/auth.py", line 90, in _is_already_running
    content = subprocess.run(
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'tasklist'
TomsonReuters commented 2 years ago

Hey! I've got the same issue, anyone know how to change all the subprocess commands? Thanks!

awebisam commented 1 year ago

I didn't see any PR for posix support so, I created it myself. Do check it out. I understand it was way back in the past so, might not be relevant to you anymore. https://github.com/areed1192/interactive-brokers-api/pull/6