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]: modular: error: failed to run python #590

Closed
indrasvat opened this issue Sep 7, 2023 · 9 comments
Closed

[Modular CLI]: modular: error: failed to run python #590

indrasvat opened this issue Sep 7, 2023 · 9 comments
Labels
mojo Issues that are related to mojo mojo-repo Tag all issues with this label mojo-tooling Tag for all issues related to repl, lldb, lsp, vscode extension.

Comments

@indrasvat
Copy link

indrasvat commented Sep 7, 2023

Issue description

Tried installing mojo on an AWS EC2 Ubuntu instance but it failed when running the various TESTS.

Steps to reproduce

# Had to use the below, modified command to get around 'permission denied' errors
$ sudo apt-get install -y apt-transport-https &&
  keyring_location=/usr/share/keyrings/modular-installer-archive-keyring.gpg &&
  sudo curl -1sLf 'https://dl.modular.com/bBNWiLZX5igwHXeu/installer/gpg.0E4925737A3895AD.key' | sudo gpg --dearmor | sudo tee -a ${keyring_location} > /dev/null &&
  sudo curl -1sLf 'https://dl.modular.com/bBNWiLZX5igwHXeu/installer/config.deb.txt?distro=debian&codename=wheezy' | sudo tee /etc/apt/sources.list.d/modular-installer.list > /dev/null &&
  sudo apt-get update &&
  sudo apt-get install -y modular
# The actual install
modular auth mut_6f44034a95b14f018e249bab3f87af24 &&
modular install mojo
# Found release for https://packages.modular.com/mojo @ 0.2.1, installing to /home/ubuntu/.modular/pkg/packages.modular.com_mojo
# Downloads complete, setting configs...
# Configs complete, running post-install hooks...
Defaulting to user installation because normal site-packages is not writeable
Collecting find_libpython==0.3.0
  Downloading find_libpython-0.3.0-py3-none-any.whl (8.5 kB)
Collecting papermill==2.4.0
  Downloading papermill-2.4.0-py3-none-any.whl (38 kB)
Collecting jupyter_client>=8.3.0
  Downloading jupyter_client-8.3.1-py3-none-any.whl (104 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 104.1/104.1 KB 1.9 MB/s eta 0:00:00
Collecting nbformat>=5.1.2
  Downloading nbformat-5.9.2-py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.6/77.6 KB 8.5 MB/s eta 0:00:00
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from papermill==2.4.0->-r /home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (5.4.1)
Collecting nbclient>=0.2.0
  Downloading nbclient-0.8.0-py3-none-any.whl (73 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73.1/73.1 KB 11.7 MB/s eta 0:00:00
Collecting entrypoints
  Downloading entrypoints-0.4-py3-none-any.whl (5.3 kB)
Requirement already satisfied: click in /usr/lib/python3/dist-packages (from papermill==2.4.0->-r /home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (8.0.3)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from papermill==2.4.0->-r /home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (2.25.1)
Collecting tqdm>=4.32.2
  Downloading tqdm-4.66.1-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.3/78.3 KB 12.0 MB/s eta 0:00:00
Collecting ansiwrap
  Downloading ansiwrap-0.8.4-py2.py3-none-any.whl (8.5 kB)
Collecting tenacity
  Downloading tenacity-8.2.3-py3-none-any.whl (24 kB)
Collecting pyzmq>=23.0
  Downloading pyzmq-25.1.1-cp310-cp310-manylinux_2_28_x86_64.whl (1.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 30.0 MB/s eta 0:00:00
Collecting traitlets>=5.3
  Downloading traitlets-5.9.0-py3-none-any.whl (117 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.4/117.4 KB 19.5 MB/s eta 0:00:00
Collecting tornado>=6.2
  Downloading tornado-6.3.3-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (427 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 427.7/427.7 KB 22.2 MB/s eta 0:00:00
Collecting jupyter-core!=5.0.*,>=4.12
  Downloading jupyter_core-5.3.1-py3-none-any.whl (93 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 93.7/93.7 KB 5.6 MB/s eta 0:00:00
Collecting python-dateutil>=2.8.2
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 KB 10.6 MB/s eta 0:00:00
Collecting platformdirs>=2.5
  Downloading platformdirs-3.10.0-py3-none-any.whl (17 kB)
Collecting fastjsonschema
  Downloading fastjsonschema-2.18.0-py3-none-any.whl (23 kB)
Requirement already satisfied: jsonschema>=2.6 in /usr/lib/python3/dist-packages (from nbformat>=5.1.2->papermill==2.4.0->-r /home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (3.2.0)
Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.8.2->jupyter_client>=8.3.0->-r /home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 3)) (1.16.0)
Collecting textwrap3>=0.9.2
  Downloading textwrap3-0.9.2-py2.py3-none-any.whl (12 kB)
Installing collected packages: textwrap3, find_libpython, fastjsonschema, traitlets, tqdm, tornado, tenacity, pyzmq, python-dateutil, platformdirs, entrypoints, ansiwrap, jupyter-core, nbformat, jupyter_client, nbclient, papermill
  WARNING: The script find_libpython is installed in '/home/ubuntu/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script tqdm is installed in '/home/ubuntu/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts jupyter, jupyter-migrate and jupyter-troubleshoot are installed in '/home/ubuntu/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script jupyter-trust is installed in '/home/ubuntu/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts jupyter-kernel, jupyter-kernelspec and jupyter-run are installed in '/home/ubuntu/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script jupyter-execute is installed in '/home/ubuntu/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script papermill is installed in '/home/ubuntu/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed ansiwrap-0.8.4 entrypoints-0.4 fastjsonschema-2.18.0 find_libpython-0.3.0 jupyter-core-5.3.1 jupyter_client-8.3.1 nbclient-0.8.0 nbformat-5.9.2 papermill-2.4.0 platformdirs-3.10.0 python-dateutil-2.8.2 pyzmq-25.1.1 tenacity-8.2.3 textwrap3-0.9.2 tornado-6.3.3 tqdm-4.66.1 traitlets-5.9.0
Testing `MODULAR_HOME=/home/ubuntu/.modular`
* `/home/ubuntu/.modular/pkg/packages.modular.com_mojo/bin/mojo`...
TEST: `mojo --help`... OK
TEST: `mojo run --help`... OK
TEST: `mojo build test_mandelbrot.mojo`... OK
TEST: `mojo build test_python.mojo`... OK
TEST: `mojo demangle`... OK
TEST: `mojo format`... OK
TEST: `mojo package`... ERROR
Traceback (most recent call last):
  File "/home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py", line 342, in <module>
    main()
  File "/home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py", line 338, in main
    tester.test(args.test_jupyter)
  File "/home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py", line 273, in test
    self.test_mojo_package()
  File "/home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py", line 156, in test_mojo_package
    "This is a function in a package"
AssertionError
modular: error: failed to run python:

Version Info

$ modular -v
modular 0.1.4 (6b54d308)

$uname -a
Linux ip-10-125-42-210 5.19.0-1025-aws #26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.2 LTS
Release:	22.04
Codename:	jammy

$ python3 -V
Python 3.10.12

$ ls -Altr `which python3`
lrwxrwxrwx 1 root root 10 Aug 18  2022 /usr/bin/python3 -> python3.10
@indrasvat indrasvat added the modular-cli modular tool issues label Sep 7, 2023
@bzcheeseman bzcheeseman added mojo-tooling Tag for all issues related to repl, lldb, lsp, vscode extension. mojo Issues that are related to mojo and removed modular-cli modular tool issues labels Sep 7, 2023
@bzcheeseman
Copy link
Contributor

Rerouting to mojo tooling for now.

@sangshuduo
Copy link

sangshuduo commented Sep 12, 2023

same here with ubuntu 2204, python 3.10

@JeffersonLPLima
Copy link

JeffersonLPLima commented Sep 12, 2023

same here:

TEST: `mojo --help`... OK
TEST: `mojo run --help`... OK
TEST: `mojo build test_mandelbrot.mojo`... OK
TEST: `mojo build test_python.mojo`... ERROR
...

 "This was built inside of python"
AssertionError
modular: error: failed to run python:

OS: Windows 11 (Ubuntu 20.04 LTS - wsl2 )
Python 3.8.10

@JeffersonLPLima
Copy link

JeffersonLPLima commented Sep 12, 2023

update:
The problem was solved by following the Manual installation steps (https://developer.modular.com/download) inside sudo su environment

@automata
Copy link

I was getting exactly the same modular: error: failed to run python: but after digging a bit more (I edited the ~/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py script and printed the self.run_mojo("--help") output) and that made me realize there's some issue with the installed mojo bin:

~$ /home/vilson/.modular/pkg/packages.modular.com_mojo/bin/mojo
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /home/vilson/.modular/pkg/packages.modular.com_mojo/bin/mojo
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mojo      0x000055d3ffeb1f17
1  mojo      0x000055d3ffeafaee
2  mojo      0x000055d3ffeb25ef
3  libc.so.6 0x00007fd763974520
4  mojo      0x000055d401827850
5  mojo      0x000055d401827abb
6  mojo      0x000055d400277c09
7  mojo      0x000055d3ffe5c23a
8  libc.so.6 0x00007fd76395bd90
9  libc.so.6 0x00007fd76395be40 __libc_start_main + 128
10 mojo      0x000055d3ffe5c12e
Illegal instruction (core dumped)

I followed both the script-based and the manual-based installation (also tried running as root, although not recommended), and got the same broken mojo bin. I'm running Ubuntu 22.04 and Python 3.10.12.

@mr-sk
Copy link

mr-sk commented Sep 19, 2023

Same issue as above. Tried both manual and script install.

TEST: `mojo package`... ERROR
Traceback (most recent call last):
  File "/home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py", line 342, in <module>
    main()
  File "/home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py", line 338, in main
    tester.test(args.test_jupyter)
  File "/home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py", line 273, in test
    self.test_mojo_package()
  File "/home/ubuntu/.modular/pkg/packages.modular.com_mojo/scripts/post-install/self-test.py", line 156, in test_mojo_package
    "This is a function in a package"
AssertionError
modular: error: failed to run python:
ubuntu@ip-x:~$ python3 --version
Python 3.10.12
ubuntu@ip-x:~$ modular --version
modular 0.1.4 (6b54d308)
ubuntu@ip-x:~$ uname -a
Linux ip-x 5.19.0-1025-aws #26~22.04.1-Ubuntu SMP Mon Apr 24 01:58:15 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

@automata
Copy link

With the new 0.3.0 release the issue got fixed! 🎉 I just had to clean and install again:

modular clean
modular install mojo

@jackos
Copy link
Collaborator

jackos commented Sep 25, 2023

This are multiple issues reported here, some resolved by mojo 0.3.0, others resolved by creating a venv before installing:

python3 -m venv venv
source venv/bin/activate

venv and hang during TEST: mojo build test_python.mojo... ERROR will be resolved in next release.

@abdulghani91
Copy link

I have this problem I dont know what I have to do can anyone help me:

modular
Failed to initialize Crashpad. Crash reporting will not be available. Cause: /home/.modular could not be created: Permission denied
modular: error: no command provided

usage: modular [options]

For more information, try 'modular --help'.
abdulghani@abdulghani:~$ modular install mojo
Failed to initialize Crashpad. Crash reporting will not be available. Cause: /home/.modular could not be created: Permission denied
modular: /__w/modular/modular/Support/lib/Entitlements/EntitlementStore.cpp:771: static M::EntitlementStore M::EntitlementStore::alwaysOpen(M::HTTPContextRef, llvm::raw_ostream &): Assertion `!newOr.isError()' failed.
Please submit a bug report to https://github.com/modularml/max/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0. Program arguments: modular install mojo
#0 0x000055e608cca207 (/usr/bin/modular+0x550207)
#1 0x000055e608cc7ebe (/usr/bin/modular+0x54debe)
#2 0x000055e608cca8cf (/usr/bin/modular+0x5508cf)
#3 0x00007f20e82bd420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f20e7cf900b raise /build/glibc-wuryBv/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f20e7cd8859 abort /build/glibc-wuryBv/glibc-2.31/stdlib/abort.c:81:7
#6 0x00007f20e7cd8729 get_sysdep_segment_value /build/glibc-wuryBv/glibc-2.31/intl/loadmsgcat.c:509:8
#7 0x00007f20e7cd8729 _nl_load_domain /build/glibc-wuryBv/glibc-2.31/intl/loadmsgcat.c:970:34
#8 0x00007f20e7ce9fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#9 0x000055e609fba2f6 (/usr/bin/modular+0x18402f6)
#10 0x000055e6091098f3 (/usr/bin/modular+0x98f8f3)
#11 0x000055e608ca1d44 (/usr/bin/modular+0x527d44)
#12 0x000055e608c9f7e2 (/usr/bin/modular+0x5257e2)
#13 0x00007f20e7cda083 __libc_start_main /build/glibc-wuryBv/glibc-2.31/csu/../csu/libc-start.c:342:3
#14 0x000055e608c9ee9e (/usr/bin/modular+0x524e9e)
Aborted (core dumped)

I am using ubuntu 20.04
modular version: 0.5
mojo version: 0.7

I tried to remove mojo and modular several time still the same problem?

@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
mojo Issues that are related to mojo mojo-repo Tag all issues with this label mojo-tooling Tag for all issues related to repl, lldb, lsp, vscode extension.
Projects
None yet
Development

No branches or pull requests

9 participants