Script not working
Closed this issue · 4 comments
Hello, I have created an API from Bitmex (full access). I have filled in the API_key_bmex_test
and API_secret_bmex_test
into the sybrain.py
file.
After I run the script using python sysbrain.py
and I have this error:
%PYTHON_PATH%\Python37\lib\site-packages\swagger_spec_validator\validator20.py:53: SwaggerValidationWarning: Found "$ref: #/definitions/UserPreferences" with siblings that will be overwritten. See https://stackoverflow.com/a/48114924 for more information. (path #/definitions/User/properties/preferences)
ref_dict['$ref'], '/'.join(path),
It began in Africa...
Launching Machine learning Module...
Start: 2019-10-26 11:58:00 / End: 2019-10-26 12:03:00
C-V: [-1.7763431 -1.32638784 0.32013584]
Tst: [0.84464452 0.83262625 0.84621393]
Trn: [0.90700954 0.8784305 0.91816389]
None
'NoneType' object has no attribute 'loc'
This is the end !
Traceback (most recent call last):
File "sybrain.py", line 367, in <module>
bmex()
File "sybrain.py", line 276, in bmex
while ws_bmex.ws.sock.connected:
AttributeError: 'NoneType' object has no attribute 'connected'
Could you help me?
Thanks
Hello !
Have you created your API key from BitMex testnet or real ?
If it's a real account api key, try relaunching the script because it might fail at the first attempt to connect through websocket...
Best regards
Hello, thanks for your reply. I'm using python 3.8 on windows 8.1 and I tried to install dependencies using pip3 install -r requirements.txt
. I have some problems:
ERROR: Command errored out with exit status 1: 'c:\users\pc-enter\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\PC-Enter\\AppData\\Local\\Temp\\pip-install-0eiut9jr\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\PC-Enter\\AppData\\Local\\Temp\\pip-install-0eiut9jr\\matplotlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\PC-Enter\AppData\Local\Temp\pip-record-x70wtke2\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
I did this command again: python sybrain.py
and you can see the following error message:
sybrain.py:121: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if len(ws_bmex.open_stops()) is not 0:
sybrain.py:124: SyntaxWarning: "is" with a literal. Did you mean "=="?
if len(ws_bmex.open_stops()) is 0 and covering_fee(buyPos_init, matrix_bmex_ticker[2], 'buy'):
sybrain.py:136: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if len(ws_bmex.open_stops()) is not 0:
sybrain.py:197: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if len(ws_bmex.open_stops()) is not 0:
sybrain.py:200: SyntaxWarning: "is" with a literal. Did you mean "=="?
if len(ws_bmex.open_stops()) is 0 and covering_fee(sellPos_init, matrix_bmex_ticker[1], 'sell'):
sybrain.py:212: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if len(ws_bmex.open_stops()) is not 0:
Traceback (most recent call last):
File "sybrain.py", line 3, in <module>
from stocks import Main # Machine Learning Module
File "C:\Users\PC-Enter\Projet\SyBrain\stocks.py", line 8, in <module>
from stockpredictor import StockPredictor, ParseData, PlotData
File "C:\Users\PC-Enter\Projet\SyBrain\stockpredictor.py", line 16, in <module>
from sklearn.preprocessing import StandardScaler
ModuleNotFoundError: No module named 'sklearn'
Could you help me again? :)
Thank you
I would try to create a new virtual environment and restart installing dependancies.
Anaconda allows the user to do so quiet easily.
conda create -n yourenvname python=x.x anaconda
Hello,
I tried to install on ubuntu 18.04 (linux) with python 3.6. I installed the requirement.txt
with your command. All was installed correctly! After I entered key and secret from bitmex (real) with full access. Then I start the following command: python3 sysbrain.py
. See the error result:
$ python3 sybrain.py
/home/PC-Enter/.local/lib/python3.6/site-packages/swagger_spec_validator/validator20.py:53: SwaggerValidationWarning: Found "$ref: #/definitions/UserPreferences" with siblings that will be overwritten. See https://stackoverflow.com/a/48114924 for more information. (path #/definitions/User/properties/preferences)
ref_dict['$ref'], '/'.join(path),
It began in Africa...
Launching Machine learning Module...
Start: 2019-11-11 13:41:00 / End: 2019-11-11 13:46:00
time data '2019-11-11 13:41:00+00:00' does not match format '%Y-%m-%d %H:%M:%S%z'
This is the end !
Traceback (most recent call last):
File "sybrain.py", line 367, in <module>
bmex()
File "sybrain.py", line 276, in bmex
while ws_bmex.ws.sock.connected:
AttributeError: 'NoneType' object has no attribute 'connected'
Any ideas? Thanks :)