Logan
Logan
MModular
Created by Logan on 11/28/2023 in #questions
Python print statements don't seem to do anything when deployed to server
from python import Python

fn main() raises:
try:
Python.add_to_path("./")
let bot = Python.import_module("main")
print("Starting Bot with Mojo")
_ = bot.main()
except e:
print("Error in main: ", e)
from python import Python

fn main() raises:
try:
Python.add_to_path("./")
let bot = Python.import_module("main")
print("Starting Bot with Mojo")
_ = bot.main()
except e:
print("Error in main: ", e)
In this code, when I deploy to railway it runs in a docker container. The issue is that "Starting Bot with Mojo" will print, but nothing I print inside the main function, which is python will work. Any idea why this could be? Is the docker container suppressing output somehow? Whenever I run locally, everything prints fine
3 replies
MModular
Created by Logan on 10/19/2023 in #questions
Docker Container Issues
I've been trying to build a docker container for a while and I'm not sure what I'm doing wrong. No matter what I do I get something like this on the install mojo command. Any ideas?
=> ERROR [ 5/10] RUN modular install mojo 0.2s
------
> [ 5/10] RUN modular install mojo:
0.186 modular: error: Could not open cache index 0 size: No such file or directory
------
Dockerfile:26
--------------------
24 |
25 | RUN curl https://get.modular.com | MODULAR_AUTH=AUTHKEYHERE sh -
26 | >>> RUN modular install mojo
27 |
28 | ARG MODULAR_HOME="/root/.modular"
--------------------
ERROR: failed to solve: process "/bin/sh -c modular install mojo" did not complete successfully: exit code: 1
=> ERROR [ 5/10] RUN modular install mojo 0.2s
------
> [ 5/10] RUN modular install mojo:
0.186 modular: error: Could not open cache index 0 size: No such file or directory
------
Dockerfile:26
--------------------
24 |
25 | RUN curl https://get.modular.com | MODULAR_AUTH=AUTHKEYHERE sh -
26 | >>> RUN modular install mojo
27 |
28 | ARG MODULAR_HOME="/root/.modular"
--------------------
ERROR: failed to solve: process "/bin/sh -c modular install mojo" did not complete successfully: exit code: 1
7 replies
MModular
Created by Logan on 10/19/2023 in #questions
unable to locate module 'list'
No description
2 replies