Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install datetime python library? #14

Open
dhcho-dnotitia opened this issue Oct 15, 2024 · 3 comments
Open

install datetime python library? #14

dhcho-dnotitia opened this issue Oct 15, 2024 · 3 comments

Comments

@dhcho-dnotitia
Copy link

Hello, currently trying to use your wonderful work.

when trying to fetch some historical data (tics or trade logs), I've got some errors which designates that there is no 'datetime' library.

I tried to install to the library into the running docker container as below but still failed to resolve the error.

sudo wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Python39-32/python.exe -m pip install datetime

any ideas on it?

@gmag11
Copy link
Owner

gmag11 commented Oct 17, 2024

Hi. So you mean internal Wine misses datetime library, don't you? Can you copy the log here?

@dhcho-dnotitia
Copy link
Author

dhcho-dnotitia commented Oct 17, 2024

I tried to follow the example in the link.

After mt5 login,

from_date=datetime.datetime(2020,1,1)
to_date=datetime.datetime.now()
history_orders=fxs.mt5_l.history_orders_get(from_date, to_date, group="*GBP*")

the output msg is as follows:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[3], [line 3](vscode-notebook-cell:?execution_count=3&line=3)
      [1](vscode-notebook-cell:?execution_count=3&line=1) from_date=datetime.datetime(2020,1,1)
      [2](vscode-notebook-cell:?execution_count=3&line=2) to_date=datetime.datetime.now()
----> [3](vscode-notebook-cell:?execution_count=3&line=3) history_orders=fxs.mt5_l.history_orders_get(from_date, to_date, group="*GBP*")

File /opt/conda/lib/python3.10/site-packages/mt5linux/__init__.py:3763, in MetaTrader5.history_orders_get(self, *args, **kwargs)
   [3626](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f66782d686f73742d64656d6f2d646863686f227d-0040ssh-002dremote-002b7b22686f73744e616d65223a22444e2d707269766174652d736572766572227d.vscode-resource.vscode-cdn.net/opt/conda/lib/python3.10/site-packages/mt5linux/__init__.py:3626)         r'''
   [3627](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f66782d686f73742d64656d6f2d646863686f227d-0040ssh-002dremote-002b7b22686f73744e616d65223a22444e2d707269766174652d736572766572227d.vscode-resource.vscode-cdn.net/opt/conda/lib/python3.10/site-packages/mt5linux/__init__.py:3627) #history_orders_get
   [3628](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f66782d686f73742d64656d6f2d646863686f227d-0040ssh-002dremote-002b7b22686f73744e616d65223a22444e2d707269766174652d736572766572227d.vscode-resource.vscode-cdn.net/opt/conda/lib/python3.10/site-packages/mt5linux/__init__.py:3628) 
   (...)
   [3760](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f66782d686f73742d64656d6f2d646863686f227d-0040ssh-002dremote-002b7b22686f73744e616d65223a22444e2d707269766174652d736572766572227d.vscode-resource.vscode-cdn.net/opt/conda/lib/python3.10/site-packages/mt5linux/__init__.py:3760) 
   [3761](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f66782d686f73742d64656d6f2d646863686f227d-0040ssh-002dremote-002b7b22686f73744e616d65223a22444e2d707269766174652d736572766572227d.vscode-resource.vscode-cdn.net/opt/conda/lib/python3.10/site-packages/mt5linux/__init__.py:3761)         '''
   [3762](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f66782d686f73742d64656d6f2d646863686f227d-0040ssh-002dremote-002b7b22686f73744e616d65223a22444e2d707269766174652d736572766572227d.vscode-resource.vscode-cdn.net/opt/conda/lib/python3.10/site-packages/mt5linux/__init__.py:3762)         code=f'mt5.history_orders_get(*{args},**{kwargs})'
-> [3763](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f66782d686f73742d64656d6f2d646863686f227d-0040ssh-002dremote-002b7b22686f73744e616d65223a22444e2d707269766174652d736572766572227d.vscode-resource.vscode-cdn.net/opt/conda/lib/python3.10/site-packages/mt5linux/__init__.py:3763)         return self.__conn.eval(code)

File /opt/conda/lib/python3.10/site-packages/rpyc/core/netref.py:240, in _make_method.<locals>.__call__(_self, *args, **kwargs)
    [238](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f66782d686f73742d64656d6f2d646863686f227d-0040ssh-002dremote-002b7b22686f73744e616d65223a22444e2d707269766174652d736572766572227d.vscode-resource.vscode-cdn.net/opt/conda/lib/python3.10/site-packages/rpyc/core/netref.py:238) def __call__(_self, *args, **kwargs):
    [239](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f66782d686f73742d64656d6f2d646863686f227d-0040ssh-002dremote-002b7b22686f73744e616d65223a22444e2d707269766174652d736572766572227d.vscode-resource.vscode-cdn.net/opt/conda/lib/python3.10/site-packages/rpyc/core/netref.py:239)     kwargs = tuple(kwargs.items())
--> [240](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f66782d686f73742d64656d6f2d646863686f227d-0040ssh-002dremote-002b7b22686f73744e616d65223a22444e2d707269766174652d736572766572227d.vscode-resource.vscode-cdn.net/opt/conda/lib/python3.10/site-packages/rpyc/core/netref.py:240)     return syncreq(_self, consts.HANDLE_CALL, args, kwargs)

File /opt/conda/lib/python3.10/site-packages/rpyc/core/netref.py:63, in syncreq(proxy, handler, *args)
     [51](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f66782d686f73742d64656d6f2d646863686f227d-0040ssh-002dremote-002b7b22686f73744e616d65223a22444e2d707269766174652d736572766572227d.vscode-resource.vscode-cdn.net/opt/conda/lib/python3.10/site-packages/rpyc/core/netref.py:51) """Performs a synchronous request on the given proxy object.
     [52](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f66782d686f73742d64656d6f2d646863686f227d-0040ssh-002dremote-002b7b22686f73744e616d65223a22444e2d707269766174652d736572766572227d.vscode-resource.vscode-cdn.net/opt/conda/lib/python3.10/site-packages/rpyc/core/netref.py:52) Not intended to be invoked directly.
...
  File "C:\Program Files (x86)\Python39-32\lib\site-packages\rpyc\core\service.py", line 156, in eval
    return eval(text, self.namespace)
  File "<string>", line 1, in <module>
NameError: name 'datetime' is not defined

hope the datetime library would be installed via Dockerfile. I tried to do it but failed..

@thepyninja
Copy link

same issue

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

No branches or pull requests

3 participants