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

Can't run Modular either Mojo on a Mac M2 #1720

Closed
1 task done
kelisituofu opened this issue Feb 2, 2024 · 5 comments
Closed
1 task done

Can't run Modular either Mojo on a Mac M2 #1720

kelisituofu opened this issue Feb 2, 2024 · 5 comments
Labels
enhancement New feature or request mojo-repo Tag all issues with this label

Comments

@kelisituofu
Copy link

kelisituofu commented Feb 2, 2024

Review Mojo's priorities

What is your request?

I have installed Modular and Mojo on MacOs M2 as the installation instructions said, but I only get error messages. For example with "modualr --version" I get following error message: "Failed to initialize Crashpad. Crash reporting will not be available. Cause: /home/saket/.modular could not be created: Operation not supported
modular 0.4.1 (2d8afe15)" or when I run a program "mojo test.mojo" I get "Failed to initialize Crashpad. Crash reporting will not be available. Cause: while creating crashpad database: Operation not supported
/Users/ceha/mojo/test.mojo:1:1: error: unable to locate module 'builtin'
fn main()
^
/Users/ceha/mojo/test.mojo:2:1: error: TODO: expressions are not yet supported at the file scope level
print("Hello World")
^
/Users/ceha/mojo/test.mojo:2:1: error: use of unknown declaration 'print'
print("Hello World")
^~~~~
/Users/ceha/mojo/test.mojo:2:1: error: unknown function effect 'print', expected 'raises' or 'capturing'
print("Hello World")
^
/Users/ceha/mojo/test.mojo:2:6: error: expected ':' in function definition
print("Hello World")
^
/Users/ceha/mojo/test.mojo:2:7: error: could not find builtin 'StringLiteral' type
print("Hello World")
^
mojo: error: failed to parse the provided Mojo"

But I've found nozhing about these issues. Please help!

What is your motivation for this change?

I can't work with mojo

Any other details?

No response

@kelisituofu kelisituofu added enhancement New feature or request mojo Issues that are related to mojo labels Feb 2, 2024
@Sharktheone
Copy link

It looks like you have tried to run code without a function.
Currently you need a function in order to use mojo.

So, you need to do this:

fn main():
    print("Hello, world!")

@jackos
Copy link
Collaborator

jackos commented Feb 2, 2024

It says it can't create /home/saket/.modular but your user is /Users/ceha/mojo/

Can you try starting from scratch.

First, remove the PATH and MODULAR_HOME you added for Mojo in your ~/.zshrc and then run:

rm -r ~/.modular
brew uninstall modular
curl https://get.modular.com | sh -
modular auth <your-token>
modular install mojo

And add the new PATH and MODULAR_HOME it prompts in your ~/.zshrc

@kelisituofu
Copy link
Author

kelisituofu commented Feb 3, 2024

It says it can't create /home/saket/.modular but your user is /Users/ceha/mojo/

Can you try starting from scratch.

First, remove the PATH and MODULAR_HOME you added for Mojo in your ~/.zshrc and then run:

rm -r ~/.modular
brew uninstall modular
curl https://get.modular.com | sh -
modular auth <your-token>
modular install mojo

And add the new PATH and MODULAR_HOME it prompts in your ~/.zshrc

Hello jackos,
thanks for your advice. I did it like you said but when I type "modular install mojo", I get now following error message: "Failed to initialize Crashpad. Crash reporting will not be available. Cause: /home/saket/.modular could not be created: Operation not supported
modular: error: please run modular auth before attempting to install a package" BUT I runned my modular auth!

And if I repeat my modular auth I get following error message: "Failed to initialize Crashpad. Crash reporting will not be available. Cause: /home/saket/.modular could not be created: Operation not supported
modular: error: /home/saket/.modular could not be created: Operation not supported"

@jackos
Copy link
Collaborator

jackos commented Feb 3, 2024

@ceha80 It's strange that it's using the path: /home/saket/.modular because that's a Linux path, macOS looks like /Users/saket/.modular

Make sure that MODULAR_HOME is not set, running this should return nothing:

echo $MODULAR_HOME

If that's returning /home/saket/.modular remove it from your ~/.bashrc or ~/.zshrc, restart the terminal, and run the steps above again.

The only other thing I can think of is to make sure you're using arm64 homebrew. You can follow the steps here to check and fix that

@kelisituofu
Copy link
Author

@ceha80 It's strange that it's using the path: /home/saket/.modular because that's a Linux path, macOS looks like /Users/saket/.modular

Make sure that MODULAR_HOME is not set, running this should return nothing:

echo $MODULAR_HOME

If that's returning /home/saket/.modular remove it from your ~/.bashrc or ~/.zshrc, restart the terminal, and run the steps above again.

The only other thing I can think of is to make sure you're using arm64 homebrew. You can follow the steps here to check and fix that

Unfortunately, nothing works. I only recently bought this MacBook Air because I'm tired of screwing around with Linux for ages until something works properly. Unfortunately, I have to say that it's at least the same with Mac.

Can someone explain to me why this simply doesn't work with a new Mac?

@ematejska ematejska added mojo-tooling Tag for all issues related to repl, lldb, lsp, vscode extension. and removed mojo-tooling Tag for all issues related to repl, lldb, lsp, vscode extension. labels Feb 27, 2024
@linear linear bot removed the mojo Issues that are related to mojo label Apr 29, 2024
@ematejska ematejska added the mojo-repo Tag all issues with this label label Apr 29, 2024
@Mogball Mogball closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

5 participants