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

[Modular CLI]: M2 Mac air , fail to install new mojo even afeter clean modular/old mojo. Encounter modular: error: Error extracting /: Can't remove already-existing dir #1912

Closed
ChesterHsieh opened this issue Mar 8, 2024 · 12 comments
Assignees
Labels
modular-cli modular tool issues mojo-repo Tag all issues with this label

Comments

@ChesterHsieh
Copy link

Issue description

As ttile, While I try to update mojo to 24.1 from 0.7.0. It works fine with older version.

Steps to reproduce

  1. Clean env. I've check both zsh and modular and mojo. None of them could be found.
Screen Shot 2024-03-08 at 5 52 37 PM
  1. Install mojo
image

Version Info

- Provide Modular CLI version by pasting the output of `modular -v`
-> 0.5.1 
- What OS did you install modular CLI on ?
-> macOS Monterey 12.5
@ChesterHsieh ChesterHsieh added the modular-cli modular tool issues label Mar 8, 2024
@ChesterHsieh
Copy link
Author

@zbowling any update? Is that any extra information I could provide to boost the process?

@zbowling
Copy link

Can you run modular clean and the run modular install mojo again?

@ser-yk
Copy link

ser-yk commented Mar 14, 2024

I have same issue on M1 Monterey.
modular clean and the run modular install mojo takes same error.

Снимок экрана 2024-03-14 в 13 37 28

Can you run modular clean and the run modular install mojo again?

@ChesterHsieh
Copy link
Author

same here. re run both still encounter same error.

@zbowling
Copy link

zbowling commented Mar 14, 2024

can you tell me what version of modular you are running with modular --version? The most recent version is 0.5.2. It might not fix the issue being on the latest but I can check more telemetry on our end of this type of bug when it happens on that version.

@zbowling
Copy link

Also one thing we can try if you are willing to do an experiment for me is to run this and see if that works?

modular clean
modular install mojo --force-cas

That forces a deprecated package download method that is still used on older packages and is going away soon.

We are not seeing this error with high frequency but I'm still curious if that method works for you.

@ser-yk
Copy link

ser-yk commented Mar 14, 2024

@zbowling Thanks! This way with addition flag works.
Mojo was installed without error.
*Earlier an error occurred on modular version 0.5.2.

@ChesterHsieh
Copy link
Author

@zbowling . Add flag works! However, I still use modular 0.5.1 to test it first. Many thanks! Let's close the issue.

@hhstore
Copy link

hhstore commented Mar 22, 2024

@zbowling

Could it be because mojo doesn't support rye?

  • not works for me.
  • This may be caused by me using rye (Python package management tool) to manage Python version numbers.
  • I seem to have encountered similar errors before.
  • Last time I switched to pyenv (not rye) to switch the Python version number, and then fixed the problem.
  • However, I think mojo needs to fix this error in order to support rye, which is also a popular Python package management tool lately.

Env:

 which python
/Users/dev/.rye/shims/python


 python -V
Python 3.12.2

Error logs:

modular clean && modular install mojo --force-cas

# Found release for https://packages.modular.com/mojo @ 24.1.1-0ab415f7-release
# Collecting necessary files...
[files    124/124][bytes    118MiB/118MiB @  10.5MiB/s][██████████████████████████████] 💯%
# Downloads complete, setting configs...
# Configs complete, running post-install hooks...
Traceback (most recent call last):
  File "/Users/dev/.modular/pkg/packages.modular.com_mojo/scripts/post-install/pick_python.py", line 67, in <module>
    main()
  File "/Users/dev/.modular/pkg/packages.modular.com_mojo/scripts/post-install/pick_python.py", line 50, in main
    raise Exception(
Exception: Could not find libpython. Check your Python installation and ensure that $LD_LIBRARY_PATH includes the location to the installed Python library (e.g. /usr/lib/x86_64-linux-gnu).
modular: error: failed to run script
==========================
Failure Information:
	- Script: `PATH=/Users/dev/.pyenv/bin:/opt/homebrew/opt/llvm/bin:/Users/dev/.rye/shims:/Users/dev/google-cloud-sdk/bin:/Users/dev/Library/pnpm:/Users/dev/.cargo/bin:/Users/dev/Library/Caches/fnm_multishells/70445_1710899384616/bin:/Users/dev/.pyenv/shims:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/opt/llvm/bin:/usr/local/bin:/Library/Apple/usr/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/Users/dev/bin:/Users/dev/.local/bin:/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin:/Applications/Little Snitch.app/Contents/Components:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:~/.fig/bin:~/.fnm:~/.cargo/bin:~/.local/bin:~/.yarn/bin:~/.pulumi/bin:/Users/dev/go/bin:~/sdk/android/emulator:~/sdk/android/tools:~/sdk/android/tools/bin:~/sdk/android/platform-tools:/Users/dev/Library/Android/sdk/emulator:/Users/dev/Library/Android/sdk/tools:/Users/dev/Library/Android/sdk/tools/bin:/Users/dev/Library/Android/sdk/platform-tools:/Users/dev/.gem/bin:/Users/dev/.modular/pkg/packages.modular.com_mojo/bin:~/.pyenv/bin:~/.pyenv/shims:~/.pyenv/plugins/pyenv-virtualenv/shims:/usr/local/share/dotnet/:/usr/local/share/dotnet//tools:/Users/dev/.pub-cache/bin:/Users/dev/.fvm/default/bin:/Users/dev/.fvm/default/bin/cache/dart-sdk/bin HOME=/Users/dev MODULAR_HOME=/Users/dev/.modular PYTHONPATH=/Users/dev/.modular/pkg/packages.modular.com_mojo/venv/lib/Users/dev/.modular/pkg/packages.modular.com_mojo/venv/bin/python /Users/dev/.modular/pkg/packages.modular.com_mojo/scripts/post-install/pick_python.py -installer-outfile /var/folders/pc/78th99qs10zfzdx_r683t23w0000gn/T/modular-tool-script-redirect-7e8791.tmp`
	- Result: 1
	- Stderr:
Traceback (most recent call last):
  File "/Users/dev/.modular/pkg/packages.modular.com_mojo/scripts/post-install/pick_python.py", line 67, in <module>
    main()
  File "/Users/dev/.modular/pkg/packages.modular.com_mojo/scripts/post-install/pick_python.py", line 50, in main
    raise Exception(
Exception: Could not find libpython. Check your Python installation and ensure that $LD_LIBRARY_PATH includes the location to the installed Python library (e.g. /usr/lib/x86_64-linux-gnu).


==========================

@hhstore
Copy link

hhstore commented Mar 22, 2024

Related:

$HOME/.rye/py/cpython@3.12.2
  • I tried setting the following environment variables, but it didn't work.
export LD_LIBRARY_PATH="/Users/dev/.rye/py/cpython@3.12.2/install/lib/"
export LD_LIBRARY_PATH="/Users/dev/.rye/py/cpython@3.12.2/lib/libpython3.12.dylib"
  • Python dir diff: pyenv vs rye
image

Temporary Solution:

  • Use pyenv instead of rye to manage Python versions.
 which python
/Users/dev/.pyenv/shims/python

~ on ☁️
 python --version | awk '{print $2}'
3.10.6

~ on ☁️
 modular clean && modular install mojo --force-cas
# Found release for https://packages.modular.com/mojo @ 24.1.1-0ab415f7-release
# Collecting necessary files...
[files    124/124][bytes    118MiB/118MiB @    21KiB/s][██████████████████████████████] 💯%
# Downloads complete, setting configs...
# Configs complete, running post-install hooks...

🔥 Mojo installed! 🔥

Mojo's Python virtual environment created at /Users/dev/.modular/pkg/packages.modular.com_mojo/venv

If you are using ZSH (default on macOS), run the following commands:

echo 'export MODULAR_HOME="/Users/dev/.modular"' >> ~/.zshrc
echo 'export PATH="/Users/dev/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

If you are using bash, run the following commands:

BASHRC=$( [ -f "$HOME/.bash_profile" ] && echo "$HOME/.bash_profile" || echo "$HOME/.bashrc" )
echo 'export MODULAR_HOME="/Users/dev/.modular"' >> "$BASHRC"
echo 'export PATH="/Users/dev/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> "$BASHRC"
source "$BASHRC"

Then enter 'mojo' to start the Mojo REPL.

For tool help, enter 'mojo --help'.
For more docs, see https://docs.modular.com/mojo.
image

@zbowling
Copy link

@hhstore I don't think I've tested with Rye. Can you copy your comments to a different bug and open it? It's a different issue than this one and then I can add it to the right team's triage queue.

@hhstore
Copy link

hhstore commented Mar 22, 2024

@hhstore I don't think I've tested with Rye. Can you copy your comments to a different bug and open it? It's a different issue than this one and then I can add it to the right team's triage queue.

@ematejska ematejska added the mojo-repo Tag all issues with this label label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modular-cli modular tool issues mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

5 participants