Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: I am sending you the error output when executing the attached Mojo code. #1797

Open
icst005 opened this issue Feb 23, 2024 · 1 comment
Labels
bug Something isn't working mojo-python-interop mojo-repo Tag all issues with this label

Comments

@icst005
Copy link

icst005 commented Feb 23, 2024

Bug description

-------------------------- Error Code ----------------------------
ic@DESKTOP-4QPI781:~$ '/home/ic/.modular/pkg/packages.modular.com_mojo/bin/mojo' '/home/ic/test11.mojo'
[2416:2416:20240223,165143.278591:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[2416:2416:20240223,165143.279534:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0. Program arguments: /home/ic/.modular/pkg/packages.modular.com_mojo/bin/mojo /home/ic/test11.mojo
#0 0x0000562f606b0877 (/home/ic/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x620877)
#1 0x0000562f606ae44e (/home/ic/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x61e44e)
#2 0x0000562f606b0f4f (/home/ic/.modular/pkg/packages.modular.com_mojo/bin/mojo+0x620f4f)
#3 0x00007f3b21bfe520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
Segmentation fault

------------------------- test11.mojo ----------------------
from python import Python

fn main() raises:
#from python import Python
# This is equivalent to Python's import numpy as np
let np = Python.import_module("numpy")

# Now use numpy as if writing in Python
let array = np.array([1, 2, 3])
print(array)

------------------------- Execution environment information ---------------------
Windows11
Celeron N4000/4GB/64GB eMMC
MOUSE CONPUTER MODEL:MT-E10ZN
https://www.amazon.co.jp/mouse-%E3%82%B9%E3%82%BF%E3%83%87%E3%82%A3%E3%83%91%E3%82%BD%E3%82%B3%E3%83%B3-10-1%E5%9E%8B%E3%82%BF%E3%83%96%E3%83%AC%E3%83%83%E3%83%88PC-Celeron-MT-E10ZN/dp/B09MT6ZC2F)

・Follow 「Set up on Windows」 procedure at the following URL and confirm that you have successfully executed 06.Get started with Hello World!

 ※The same applies to execution from the RUN button on VSCode or from the Ubuntu terminal.

【What I tried to solve the error】
・In VSCode, in EXTENSIONS, I installed Python Extended.
・From the Ubuntu terminal, I ran the following
  sudo apt update
  sudo apt install python3-pip
  pip3 install numpy

Steps to reproduce

  • Include relevant code snippet or link to code that did not work as expected.
  • If applicable, add screenshots to help explain the problem.
  • If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
  • Include anything else that might help us debug the issue.

System information

- What OS did you do install Mojo on ?
- Provide version information for Mojo by pasting the output of `mojo -v`
- Provide Modular CLI version by pasting the output of `modular -v`
@icst005 icst005 added bug Something isn't working mojo Issues that are related to mojo labels Feb 23, 2024
@linear linear bot removed mojo Issues that are related to mojo mojo-python-interop labels Apr 29, 2024
@ematejska ematejska added the mojo-repo Tag all issues with this label label Apr 29, 2024
@dimitrilw
Copy link

tl;dr

Granted, @icst005 is on Linux and I'm on MacOS (BSD) and I was using Mojo Nightly 2024.6.2115 (c0b36f30), so this comment of mine is immediately somewhat suspect. However, I think more information is needed from @icst005 , or perhaps the issue should be closed.

steps taken

When I tried to replicate the issue, I made this .mojo file:

from python import Python as py

fn main() raises:
    var np = py.import_module("numpy")
    var array = np.array([1, 2, 3])
    print(array)

I confirmed that I have numpy installed.

image

When running, here was the result, as expected:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo-python-interop mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

3 participants