Gab0 / japonicus

Genetic Algorithm for Gekko Trading Bot.
MIT License
284 stars 103 forks source link

SyntaxError: Non-ASCII character #166

Open 123qweas opened 6 years ago

123qweas commented 6 years ago

Hello,

if installed Japonicus as shown in the Wiki/Setup. The installation went fine but when I tried to run Japonicus with:

python japonicus-run -g --strat MACD --repeat 100 -w

The output:

Traceback (most recent call last): File "japonicus-run", line 4, in <module> import japonicus File "/Users/gekko-stable/gekko/japonicus-master/japonicus/__init__.py", line 3, in <module> from .japonicus import * File "/Users/gekko-stable/gekko/japonicus-master/japonicus/japonicus.py", line 24 SyntaxError: Non-ASCII character '\xe2' in file /Users/gekko-stable/gekko/japonicus-master/japonicus/japonicus.py on line 25, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

I have Gekko (v0.6.7) as a server running (node web/server.js)and have history data downloaded. I've took the same steps on two systems with the same error. (MacBook Pro and a Hackintosh) I also reinstalled Gekko and Japonicus - same error. The weblink in the error did not help me either.

Does anyone have an idea how to fix this?

123qweas commented 6 years ago

After installing it again I noticed that after running: sudo pip3 install -r requirements.txt I got this error at the end: Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-bdu15lux/cchardet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-u8ubswt9/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-bdu15lux/cchardet/

I don't know what that means but maybe someone knows.

verbraucher commented 6 years ago

@123qweas pls try to exceute it as follwing: python3.6 japonicus-run -g --strat MACD --repeat 100 -w

Gab0 commented 6 years ago

Yeah, try to sudo pip3 install --upgrade pip to update pip, install requirements, and run it with python3. cheers!

123qweas commented 6 years ago

Thanks for you help! Unfortunately I get an other error now: Traceback (most recent call last): File "japonicus-run", line 4, in <module> import japonicus File "/Users/gekko-stable/gekko-0.6.7/japonicus-master/japonicus/__init__.py", line 3, in <module> from .japonicus import * File "/Users/gekko-stable/gekko-0.6.7/japonicus-master/japonicus/japonicus.py", line 5, in <module> from . import Settings File "/Users/gekko-stable/gekko-0.6.7/japonicus-master/japonicus/Settings.py", line 2, in <module> import js2py ModuleNotFoundError: No module named 'js2py' After executing: python3.6 japonicus-run -g --strat MACD --repeat 100 -w

Executing python3 japonicus-run -g --strat MACD --repeat 100 -w had the same error as output.

ghost commented 6 years ago

no module named 'js2py' simply means you have to install that particular module (js2py in this case) run this for future development python3 -m pip install numpy pandas cython js2py

ghost commented 6 years ago

another thing to remember, if you install your modules with python3, you can't access them with python3.6 so keep the version in mind when installing the modules and running the code

123qweas commented 6 years ago

OK. Thank you very much. I could install all the missing modules and had to update dash. But now I get this error: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/deap/tools/_hypervolume/pyhv.py:33: ImportWarning: Falling back to the python version of hypervolume module. Expect this to be very slow. "module. Expect this to be very slow.", ImportWarning) /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/_bootstrap.py:205: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__ return f(*args, **kwds) Aborted: gekko.js not found on path specified @Settings.py; After running: python3 japonicus-run -g --strat MACD --repeat 100 -w I installed all modules with python3 but even when I use: python3.6 japonicus-run -g --strat MACD --repeat 100 -w I get the same error:

gekko-stables-iMac:japonicus-master gekko-stable$ python3 japonicus-run -g --strat MACD --repeat 100 -w /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/deap/tools/_hypervolume/pyhv.py:33: ImportWarning: Falling back to the python version of hypervolume module. Expect this to be very slow. "module. Expect this to be very slow.", ImportWarning) /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/_bootstrap.py:205: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__ return f(*args, **kwds) Aborted: gekko.js not found on path specified @Settings.py; gekko-stables-iMac:japonicus-master gekko-stable$ python3.6 japonicus-run -g --strat MACD --repeat 100 -w /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/deap/tools/_hypervolume/pyhv.py:33: ImportWarning: Falling back to the python version of hypervolume module. Expect this to be very slow. "module. Expect this to be very slow.", ImportWarning) /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/_bootstrap.py:205: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__ return f(*args, **kwds) Aborted: gekko.js not found on path specified @Settings.py; Do you think you can help me?

Gab0 commented 6 years ago

hey, the message is Aborted: gekko.js not found on path specified @Settings.py check gekko.js path at settings/global.py. cheers!