I failed to import this package. Can anyone help?
(life) $ pixi add websockets
✔ Added websockets >=15.0.1,<16
(life) $ mojo life.mojo
life.mojo:1:6: error: unable to locate module 'websockets'
from websockets.sync.client import connect
^
I failed to import this package. Can anyone help?
(life) $ pixi add websockets
✔ Added websockets >=15.0.1,<16
(life) $ mojo life.mojo
life.mojo:1:6: error: unable to locate module 'websockets'
from websockets.sync.client import connect
^
My guess is that it actually added this Python project named websockets. You may need to add the https://repo.prefix.dev/modular-community
channel to your pixi.toml and move it ahead of conda-forge to make sure it resolves the Mojo websockets
package and not the Python one.
I imported the package and got this error. Can anyone help?
from websockets.sync.client import connect
fn send_and_receive(msg: String) raises:
with connect("wss://echo.websocket.org/") as client:
client.send_text(msg)
print(">>> ", msg)
response = client.recv_text()
print("<<< ", response)
fn main() raises:
send_and_receive("Hello world!")
$ mojo life.mojo
INFO - Socket.connect: Attempting to connect to remote socket at echo.websocket.org:443
Please submit a bug report to https://github.com/modular/modular/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0. Program arguments: mojo life.mojo
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 mojo 0x0000563a259666ab
1 mojo 0x0000563a25964449
2 mojo 0x0000563a25966d5a
3 libc.so.6 0x00007fecfac67070
4 libc.so.6 0x00007fecfacc0334
5 libc.so.6 0x00007fecfac66fbe gsignal + 30
6 libAsyncRTMojoBindings.so 0x00007fecfcdb2ac2
7 libc.so.6 0x00007fecfac67070
8 (error) 0x00007fec0401cdd9
mojo crashed!
Please file a bug report.
Segmentation fault (core dumped)