Coder Social home page Coder Social logo

[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 about mojo HOT 12 CLOSED

ChesterHsieh avatar ChesterHsieh commented on May 23, 2024
[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

from mojo.

Comments (12)

ser-yk avatar ser-yk commented on May 23, 2024 2

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?

from mojo.

zbowling avatar zbowling commented on May 23, 2024 1

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.

from mojo.

ser-yk avatar ser-yk commented on May 23, 2024 1

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

from mojo.

ChesterHsieh avatar ChesterHsieh commented on May 23, 2024

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

from mojo.

zbowling avatar zbowling commented on May 23, 2024

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

from mojo.

ChesterHsieh avatar ChesterHsieh commented on May 23, 2024

same here. re run both still encounter same error.

from mojo.

zbowling avatar zbowling commented on May 23, 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.

from mojo.

ChesterHsieh avatar ChesterHsieh commented on May 23, 2024

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

from mojo.

hhstore avatar hhstore commented on May 23, 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).


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

from mojo.

hhstore avatar hhstore commented on May 23, 2024

Related:

  • #706
  • I looked at the path of the Python installed by rye, and found that it is here, and it is indeed different from the path of pyenv. (Mojo and pyenv work fine)
$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/[email protected]/install/lib/"
export LD_LIBRARY_PATH="/Users/dev/.rye/py/[email protected]/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

from mojo.

zbowling avatar zbowling commented on May 23, 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.

from mojo.

hhstore avatar hhstore commented on May 23, 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.

  • sure. I'll open another issue.
  • here: #1991

from mojo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.