Unable to start LiuAlgoTrader in Firefox
ksilo opened this issue · comments
Thank you for joining LiuAlgoTrader community and submitting your first issue. Feel free to check out Liu community: https://gitter.im/LiuAlgoTrader/community
@ksilo It looks like DB connection failed:
- Is your Docker engine working, and running the PostgreSQL?
- Are you able to connect to the DB?
Yes, I can connect using \psql -h localhost -p 5400 -U liu
@ksilo The error shows:
The installation wizard should have created a file env_vars.sh
and you're supposed to run it before running streamlit
. The file should be something like this:
export DSN=postgresql://liu:liu@localhost:5400/liu
That should direct the DB session creation to port 5400 and not 5432 -> Are you 100% sure you executed the script prior? Does it look like the above?
Can you take a screenshot of the DSN prior to running stteamlit
@amor71 I think what's happening is: installation wizard can't access
https://raw.githubusercontent.com/amor71/LiuAlgoTrader/master/examples/quickstart/
probablly that's why env_vars.sh scrip isn't created
running it manually did the job: export DSN=postgresql://liu:liu@localhost:5400/liu
@ksilo The liu application creates the file, I'm not sure what you mean by can't access it?
with open(f"{samples_location}env_vars.sh", "w") as f:
f.write(
f"export DSN=postgresql://{user}:{passwd}@localhost:5400/{db}\n"
)
Was the file not created for you, in the subfolder? Can you please confirm that and I'll look further?
sample files were not created in the sub folder, files = ["tradeplan.toml", "vwap_short.py", "momentum_long_simplified.py"], env_vars.sh scrip was not created also
I've checked liu.py source code and found out that link is not working in def setup_samples (400: Invalid request) for downloading sample files, could it be that due to this reason code for creating env_vars.sh was not executed? <-- I already figured out that this is wrong
but nor the samples nor the .sh script were created in the sub folder after installation wizard was completed
@ksilo I just restarted from scratch, and I do see the files. Can u please try to re-run the liu quickstart
and confirm you selected to create the samples. Pls see the below screenshots, LMK if you had any errors in that process, maybe something prevented the download or file creation for some reason. Thank you for checking.
After DB installation you should see this:
yep, as you see, I don't get prompt for selecting location for sample files
@ksilo Thanks for sharing the full details. I found the issue and pushed a fix. Version 0.3.27 has just been published.
The issue was that you entered "Y" instead of pressing the enter key...
This line failed:
samples = not len(i) or i.lower in ("y", "yes")
it should be:
samples = not len(i) or i.lower() in ("y", "yes")
Can you please pull the latest (0.3.27) and confirm the fix and close the issue?
Thanks much for noticing, well done!
yes! everything is working now!