Module pymatmul not found

@aespeiuk can you try changing hello_interop.mojo to this and running it:
from python.python import Python


def main():
print("Hello Mojo 🔥!")
for x in range(9, 0, -3):
print(x)
try:
Python.add_to_path(".")
Python.add_to_path("./examples")
let sys = Python.import_module("sys")
for p in sys.path:
print(p)
let test_module = Python.import_module("simple_interop")
test_module.test_interop_func()
except e:
print(e, "could not find module simple_interop")
from python.python import Python


def main():
print("Hello Mojo 🔥!")
for x in range(9, 0, -3):
print(x)
try:
Python.add_to_path(".")
Python.add_to_path("./examples")
let sys = Python.import_module("sys")
for p in sys.path:
print(p)
let test_module = Python.import_module("simple_interop")
test_module.test_interop_func()
except e:
print(e, "could not find module simple_interop")
And show me the output thanks
17 Replies
aespeiuk
aespeiuk15mo ago
I created a file as I could not find any file by that name
No description
Jack Clayton
Jack ClaytonOP15mo ago
@aespeiuk what happens when you do:
pwd -P
pwd -P
Thinking there might be a symbolic link causing problems
aespeiuk
aespeiuk15mo ago
No description
Jack Clayton
Jack ClaytonOP15mo ago
can you show:
ls -lah
ls -lah
aespeiuk
aespeiuk15mo ago
yes
No description
aespeiuk
aespeiuk15mo ago
root dir
No description
Jack Clayton
Jack ClaytonOP15mo ago
Yeah there's no simple_interop.py in there, do this:
cd ~/Documents/mojo
rm -rf mojo
git clone https://github.com/modularml/mojo
cd ~/Documents/mojo
rm -rf mojo
git clone https://github.com/modularml/mojo
Then try again
aespeiuk
aespeiuk15mo ago
deleted folder under Documents and tried git clone https://github.com/modularml/mojo again
GitHub
GitHub - modularml/mojo: The Mojo Programming Language
The Mojo Programming Language. Contribute to modularml/mojo development by creating an account on GitHub.
No description
aespeiuk
aespeiuk15mo ago
same issue
aespeiuk
aespeiuk15mo ago
this is the new folder downloaded
No description
Jack Clayton
Jack ClaytonOP15mo ago
There's no .py files in there Put the files from here: https://github.com/modularml/mojo/tree/main/examples Ending in .py there manually
aespeiuk
aespeiuk15mo ago
I'm not sure why the .py files are not downloaded trying
aespeiuk
aespeiuk15mo ago
it worked
No description
aespeiuk
aespeiuk15mo ago
Some issue related to the github! @Jack Clayton thanks again !
amrsanders
amrsanders15mo ago
Its so wierd why the .py files didn't download. I had the same issue... I'm not sure if this is relevant but when I "cd"-ed into mojo/examples, the git info shown to me was this: It was shown to me like that right after cloning.
No description
Alperen ÜNLÜ
Alperen ÜNLÜ15mo ago
i have the pyfiles but still get the same error
❯ mojo examples/matmul.mojo
Unhandled exception caught during execution: No module named 'pymatmul'
mojo: error: execution exited with a non-zero result: 1
❯ mojo examples/matmul.mojo
Unhandled exception caught during execution: No module named 'pymatmul'
mojo: error: execution exited with a non-zero result: 1
quick solve i should have cd into examples first then it worked
urbanaut
urbanaut15mo ago
@Jack Clayton I too had this problem & snagged the files out of the repo manually. It's fine now. I don't know if it's worth trying: git clone -c core.symlinks=true https://github.com/modularml/mojo ?
Want results from more Discord servers?
Add your server