hhstore / blog

My Tech Blog: about Mojo / Rust / Golang / Python / Kotlin / Flutter / VueJS / Blockchain etc.
https://github.com/hhstore/blog/issues
295 stars 24 forks source link

Mojo: Quickstart - Setup on MacOS(intel) with Orbstack #411

Open hhstore opened 1 year ago

hhstore commented 1 year ago

๐Ÿ“– Abstract:

๐Ÿ’ฏ Related:

hhstore commented 1 year ago

Mojo ๆ•™็จ‹:

Mojo ๅฎ˜็ฝ‘:

Mojo ๆˆๅŠŸๅฎ‰่ฃ…:

๐Ÿ”ฅ MacOS:

๐Ÿ”ฅ Windows:

๐Ÿ”ฅ MacOS + Orbstack + ่™šๆ‹Ÿๆœบ ๅฎ‰่ฃ…ๆ•™็จ‹:

๐Ÿ”ฅ MacOS + Mojo ๅฎ‰่ฃ…ๆต็จ‹ๆ€ป่ฏดๆ˜Ž:

  1. โœ… MacOS ๅฎ‰่ฃ… orbstack.
  2. โœ… ไฝฟ็”จ orbstack ๅˆ›ๅปบ Ubuntu ่™šๆ‹Ÿๆœบ:
    • โœ… orbstack ่™šๆ‹Ÿๆœบ่ต„ๆบ่ฆๆฑ‚: CPU 2ๆ ธ+, ๅ†…ๅญ˜ 8G+ (ไบฒๆต‹ OK)
    • โœ… ๆณจๆ„้™ๅˆถ็‰ˆๆœฌไธบ Ubuntu 20.04.6 LTS, ๅ’Œๅฎ˜ๆ–นๅฏน้ฝ.
    • โœ… (ๅฆๅˆ™ๆœ‰ๅ„็งๆŠฅ้”™, ๆตช่ดนๆ—ถ้—ด่ฐƒ่ฏ•)
  3. โœ… Ubuntu ่™šๆ‹Ÿๆœบไธญ:
    • a. โœ… ๅฎ‰่ฃ…ๅ„็งไพ่ต–(git,zsh, pip, ...), ๆœ‰่ฏฆ็ป†่„šๆœฌ.
    • b. โœ… ้ข„่ฎพ็ฝฎ mojo ็Žฏๅขƒๅ˜้‡ + ไพ่ต–็Žฏๅขƒๅ˜้‡.
    • c. โœ… ๅฎ‰่ฃ… modular.
    • d. โœ… ๅฎ‰่ฃ… mojo.
    • e. โœ… ๆต‹่ฏ• mojo, print("hi") ๆญฃๅธธ. (็ป“ๆŸ)
  4. โœ… ้…็ฝฎ Vscode + ๆ’ไปถ.

ๅฎ‰่ฃ…็Žฏๅขƒ่ฆๆฑ‚:

image

้ฟๅ‘ๆŒ‡ๅ—:

้™ๅฎš OS ็‰ˆๆœฌ:

้™ๅฎš python ็‰ˆๆœฌ:

้ข„ๅ…ˆ่ฎพ็ฝฎ็Žฏๅขƒๅ˜้‡:

hhstore commented 1 year ago

Ubuntu 20.04.6 LTS ๅˆๅง‹ๅŒ–ๆ•™็จ‹:


# ไธ€ไปถๅฎ‰่ฃ…ๅ‘ฝไปค, ๅฆ‚ๆžœๅคฑ่ดฅ, ้‡่ฏ•ๅ‡ ๆฌก:
modular clean && modular auth mut_a27b34525bed433bb61ea88654a814bb &&
modular install mojo

ๅฎ‰่ฃ…ๆˆๅŠŸๆˆชๅ›พ:

image

Mojo ๅฎ‰่ฃ…้ƒจๅˆ†ๆˆๅŠŸๆˆชๅ›พ:

image image
hhstore commented 1 year ago

่ฎพ็ฝฎ mojo ็Žฏๅขƒๅ˜้‡

zsh:


echo 'export MODULAR_HOME="$HOME/.modular"' >> ~/.zshrc

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

source ~/.zshrc
# common:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc

source ~/.zshrc

bash:


echo 'export MODULAR_HOME="$HOME/.modular"' >> ~/.bashrc

echo 'export PATH="$MODULAR_HOME/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.bashrc

source ~/.bashrc
hhstore commented 1 year ago

Linux ๅฎ‰่ฃ… mojo:

Ubuntu 20 ๅฎ‰่ฃ… modular


# ่ฟ›ๅ…ฅ่™šๆ‹Ÿๆœบ็Žฏๅขƒ:
orb 

# ๅฎ‰่ฃ… modular

curl https://get.modular.com | \
  MODULAR_AUTH=mut_a27b34525bed433bb61ea88654a814bb \
  sh -

Ubuntu 20 ๅฎ‰่ฃ… mojo:


# ่ฟ›ๅ…ฅ่™šๆ‹Ÿๆœบ็Žฏๅขƒ:
orb 

# ้œ€่ฆๅŠ  sudo, ๆˆ–่€… su - root, ๅˆ‡ๆขๅˆฐ root ็”จๆˆท:
modular auth mut_a27b34525bed433bb61ea88654a814bb &&
modular install mojo

# ๅฆ‚ๆžœๅฎ‰่ฃ…ๅคฑ่ดฅ, ้™ๆต, ้‡่ฏ•ๅ‰้œ€่ฆ clean:
modular clean && modular auth mut_a27b34525bed433bb61ea88654a814bb &&
modular install mojo
hhstore commented 1 year ago

ๅฎ‰่ฃ… pyenv + python 3.10:


# ๆŸฅ็œ‹็‰ˆๆœฌ:
โžœ python -V
Python 3.11.2

curl https://pyenv.run | bash

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc

souce ~/.zshrc

# ้ชŒ่ฏ:
pyenv

# ็ญ›้€‰็‰ˆๆœฌ:
pyenv install --list | grep 3.10

# ๅฎ‰่ฃ…:
pyenv install 3.10.13
hhstore commented 1 year ago

VScode ่ฎพ็ฝฎ:

ๅฎ‰่ฃ… mojo ๆ’ไปถ:

ๆ’ไปถ่ฎพ็ฝฎ:

/Users/geek/OrbStack/ubuntu20/home/geek/.modular
image
hhstore commented 1 year ago

mojo ๅฎ‰่ฃ…็›ธๅ…ณๆŠฅ้”™:

mojo ๅฎ‰่ฃ… proxy:

zip ๆ‰“ๅŒ…:


apt install -y zip
hhstore commented 1 year ago

ๅฎ‰่ฃ…ๆˆๅŠŸๆ—ฅๅฟ—:

ubuntu20 ๅฎ‰่ฃ… modular:


โ•ญโ”€geek at ubuntu20 in ~
โ•ฐโ”€โ—‹ curl https://get.modular.com | \
  MODULAR_AUTH=mut_a27b34525bed433bb61ea88654a814bb \
  sh -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3176  100  3176    0     0   4954      0 --:--:-- --:--:-- --:--:--  4947
Executing the  setup script for the 'modular/installer' repository ...

   OK: Checking for required executable 'curl' ...
   OK: Checking for required executable 'apt-get' ...
   OK: Detecting your OS distribution and release using system methods ...
 ^^^^: ... Detected/provided for your OS/distribution, version and architecture:
 >>>>:
 >>>>: ... distro=ubuntu  version=20.04  codename=focal  arch=x86_64
 >>>>:
 NOPE: Checking for apt dependency 'apt-transport-https' ...
   OK: Updating apt repository metadata cache ...
   OK: Attempting to install 'apt-transport-https' ...
   OK: Checking for apt dependency 'ca-certificates' ...
   OK: Checking for apt dependency 'gnupg' ...
   OK: Checking for apt signed-by key support ...
   OK: Importing 'modular/installer' repository GPG keys ...
   OK: Checking if upstream install config is OK ...
   OK: Installing 'modular/installer' repository via apt ...
   OK: Updating apt repository metadata cache ...
   OK: The repository has been installed successfully - You're ready to rock!

Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  icu-devtools libicu-dev libncurses-dev libtinfo-dev libxml2-dev
Suggested packages:
  icu-doc ncurses-doc pkg-config
The following NEW packages will be installed:
  icu-devtools libicu-dev libncurses-dev libtinfo-dev libxml2-dev modular
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 56.6 MB of archives.
After this operation, 51.3 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 icu-devtools amd64 66.1-2ubuntu2.1 [189 kB]
Get:2 https://dl.modular.com/public/installer/deb/ubuntu focal/main amd64 modular amd64 0.1.4 [45.9 MB]
Ign:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libicu-dev amd64 66.1-2ubuntu2.1
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libncurses-dev amd64 6.2-0ubuntu2.1 [340 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libicu-dev amd64 66.1-2ubuntu2.1 [9,451 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libtinfo-dev amd64 6.2-0ubuntu2.1 [972 B]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libxml2-dev amd64 2.9.10+dfsg-5ubuntu0.20.04.6 [735 kB]
Fetched 56.6 MB in 52s (1,081 kB/s)
Selecting previously unselected package icu-devtools.
(Reading database ... 28157 files and directories currently installed.)
Preparing to unpack .../0-icu-devtools_66.1-2ubuntu2.1_amd64.deb ...
Unpacking icu-devtools (66.1-2ubuntu2.1) ...
Selecting previously unselected package libicu-dev:amd64.
Preparing to unpack .../1-libicu-dev_66.1-2ubuntu2.1_amd64.deb ...
Unpacking libicu-dev:amd64 (66.1-2ubuntu2.1) ...
Selecting previously unselected package libncurses-dev:amd64.
Preparing to unpack .../2-libncurses-dev_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libncurses-dev:amd64 (6.2-0ubuntu2.1) ...
Selecting previously unselected package libtinfo-dev:amd64.
Preparing to unpack .../3-libtinfo-dev_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libtinfo-dev:amd64 (6.2-0ubuntu2.1) ...
Selecting previously unselected package libxml2-dev:amd64.
Preparing to unpack .../4-libxml2-dev_2.9.10+dfsg-5ubuntu0.20.04.6_amd64.deb ...
Unpacking libxml2-dev:amd64 (2.9.10+dfsg-5ubuntu0.20.04.6) ...
Selecting previously unselected package modular.
Preparing to unpack .../5-modular_0.1.4_amd64.deb ...
Unpacking modular (0.1.4) ...
Setting up libncurses-dev:amd64 (6.2-0ubuntu2.1) ...
Setting up icu-devtools (66.1-2ubuntu2.1) ...
Setting up libicu-dev:amd64 (66.1-2ubuntu2.1) ...
Setting up libtinfo-dev:amd64 (6.2-0ubuntu2.1) ...
Setting up libxml2-dev:amd64 (2.9.10+dfsg-5ubuntu0.20.04.6) ...
Setting up modular (0.1.4) ...
  __  __           _       _
 |  \/  | ___   __| |_   _| | __ _ _ __
 | |\/| |/ _ \ / _` | | | | |/ _` | '__|
 | |  | | (_) | (_| | |_| | | (_| | |
 |_|  |_|\___/ \__,_|\__,_|_|\__,_|_|

Welcome to the Modular CLI!
For info about this tool, type "modular --help".

To install Mojo๐Ÿ”ฅ, type "modular install mojo".

For Mojo documentation, see https://docs.modular.com/mojo.
To chat on Discord, visit https://discord.gg/modular.
To report issues, go to https://github.com/modularml/mojo/issues.
โ•ญโ”€geek at ubuntu20 in ~
โ•ฐโ”€โ—‹
โ•ญโ”€geek at ubuntu20 in ~

ubuntu20 ๅฎ‰่ฃ… mojo ๆˆๅŠŸๆ—ฅๅฟ—:


โ•ญโ”€geek at ubuntu20 in ~
โ•ฐโ”€โ—‹ modular clean modular auth mut_a27b34525bed433bb61ea88654a814bb &&
modular install mojo
# Found release for https://packages.modular.com/mojo @ 0.2.1, installing to /home/geek/.modular/pkg/packages.modular.com_mojo
# Downloads complete, setting configs...
# Configs complete, running post-install hooks...
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 kB 346 kB/s
Collecting click
  Downloading click-8.1.7-py3-none-any.whl (97 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 97 kB 211 kB/s
Collecting ansiwrap
  Downloading ansiwrap-0.8.4-py2.py3-none-any.whl (8.5 kB)
Collecting nbformat>=5.1.2
  Downloading nbformat-5.9.2-py3-none-any.whl (77 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 77 kB 1.3 MB/s
Collecting tqdm>=4.32.2
  Downloading tqdm-4.66.1-py3-none-any.whl (78 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 78 kB 1.3 MB/s
Collecting tenacity
  Downloading tenacity-8.2.3-py3-none-any.whl (24 kB)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from papermill==2.4.0->-r /home/geek/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (2.22.0)
Collecting nbclient>=0.2.0
  Downloading nbclient-0.8.0-py3-none-any.whl (73 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 73 kB 1.1 MB/s
Collecting entrypoints
  Downloading entrypoints-0.4-py3-none-any.whl (5.3 kB)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from papermill==2.4.0->-r /home/geek/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 2)) (5.3.1)
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 kB 1.0 MB/s
Collecting traitlets>=5.3
  Downloading traitlets-5.9.0-py3-none-any.whl (117 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 117 kB 1.0 MB/s
Collecting importlib-metadata>=4.8.3; python_version < "3.10"
  Downloading importlib_metadata-6.8.0-py3-none-any.whl (22 kB)
Collecting jupyter-core!=5.0.*,>=4.12
  Downloading jupyter_core-5.3.1-py3-none-any.whl (93 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 93 kB 1.1 MB/s
Collecting pyzmq>=23.0
  Downloading pyzmq-25.1.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.1 MB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 1.1 MB 642 kB/s
Collecting python-dateutil>=2.8.2
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 247 kB 949 kB/s
Collecting textwrap3>=0.9.2
  Downloading textwrap3-0.9.2-py2.py3-none-any.whl (12 kB)
Collecting jsonschema>=2.6
  Downloading jsonschema-4.19.0-py3-none-any.whl (83 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 83 kB 1.1 MB/s
Collecting fastjsonschema
  Downloading fastjsonschema-2.18.0-py3-none-any.whl (23 kB)
Collecting zipp>=0.5
  Downloading zipp-3.16.2-py3-none-any.whl (7.2 kB)
Collecting platformdirs>=2.5
  Downloading platformdirs-3.10.0-py3-none-any.whl (17 kB)
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/geek/.modular/pkg/packages.modular.com_mojo/scripts/post-install/requirements.txt (line 3)) (1.14.0)
Collecting attrs>=22.2.0
  Downloading attrs-23.1.0-py3-none-any.whl (61 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 61 kB 1.1 MB/s
Collecting pkgutil-resolve-name>=1.3.10; python_version < "3.9"
  Downloading pkgutil_resolve_name-1.3.10-py3-none-any.whl (4.7 kB)
Collecting jsonschema-specifications>=2023.03.6
  Downloading jsonschema_specifications-2023.7.1-py3-none-any.whl (17 kB)
Collecting importlib-resources>=1.4.0; python_version < "3.9"
  Downloading importlib_resources-6.0.1-py3-none-any.whl (34 kB)
Collecting rpds-py>=0.7.1
  Downloading rpds_py-0.10.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 1.2 MB 896 kB/s
Collecting referencing>=0.28.4
  Downloading referencing-0.30.2-py3-none-any.whl (25 kB)
Installing collected packages: find-libpython, click, textwrap3, ansiwrap, platformdirs, traitlets, jupyter-core, attrs, pkgutil-resolve-name, zipp, importlib-resources, rpds-py, referencing, jsonschema-specifications, jsonschema, fastjsonschema, nbformat, tqdm, tenacity, tornado, importlib-metadata, pyzmq, python-dateutil, jupyter-client, nbclient, entrypoints, papermill
  WARNING: The script find_libpython is installed in '/home/geek/.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/geek/.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 jsonschema is installed in '/home/geek/.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/geek/.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/geek/.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/geek/.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/geek/.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/geek/.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 attrs-23.1.0 click-8.1.7 entrypoints-0.4 fastjsonschema-2.18.0 find-libpython-0.3.0 importlib-metadata-6.8.0 importlib-resources-6.0.1 jsonschema-4.19.0 jsonschema-specifications-2023.7.1 jupyter-client-8.3.1 jupyter-core-5.3.1 nbclient-0.8.0 nbformat-5.9.2 papermill-2.4.0 pkgutil-resolve-name-1.3.10 platformdirs-3.10.0 python-dateutil-2.8.2 pyzmq-25.1.1 referencing-0.30.2 rpds-py-0.10.2 tenacity-8.2.3 textwrap3-0.9.2 tornado-6.3.3 tqdm-4.66.1 traitlets-5.9.0 zipp-3.16.2
Testing `MODULAR_HOME=/home/geek/.modular`
* `/home/geek/.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`... OK
TEST: `mojo test_mandelbrot.mojo`... OK
TEST: `mojo test_python.mojo`... OK
hhstore commented 1 year ago

ๅฎ‰่ฃ…ๆˆๅŠŸๆฃ€ๆŸฅไพ่ต–:


โ•ญโ”€geek at ubuntu20 in ~
โ•ฐโ”€โ—‹ tree .local -L 2
.local
โ”œโ”€โ”€ bin
โ”‚ย ย  โ”œโ”€โ”€ find_libpython
โ”‚ย ย  โ”œโ”€โ”€ jsonschema
โ”‚ย ย  โ”œโ”€โ”€ jupyter
โ”‚ย ย  โ”œโ”€โ”€ jupyter-execute
โ”‚ย ย  โ”œโ”€โ”€ jupyter-kernel
โ”‚ย ย  โ”œโ”€โ”€ jupyter-kernelspec
โ”‚ย ย  โ”œโ”€โ”€ jupyter-migrate
โ”‚ย ย  โ”œโ”€โ”€ jupyter-run
โ”‚ย ย  โ”œโ”€โ”€ jupyter-troubleshoot
โ”‚ย ย  โ”œโ”€โ”€ jupyter-trust
โ”‚ย ย  โ”œโ”€โ”€ papermill
โ”‚ย ย  โ””โ”€โ”€ tqdm
โ”œโ”€โ”€ lib
โ”‚ย ย  โ””โ”€โ”€ python3.8
โ””โ”€โ”€ share
    โ””โ”€โ”€ jupyter

jupyter
hhstore commented 1 year ago

ๅฎ‰่ฃ…ๆŠฅ้”™:


18:46:08 root@debian12 ~ modular install mojo
modular: error: please run `modular auth` before attempting to install a package

18:46:38 root@debian12 ~ modular auth mut_a27b34525bed433bb61ea88654a814bb &&                                                              1 โ†ต
modular install mojo
# Found release for https://packages.modular.com/mojo @ 0.2.1, installing to /root/.modular/pkg/packages.modular.com_mojo
# Downloads complete, setting configs...
# Configs complete, running post-install hooks...
error: externally-managed-environment

ร— This environment is externally managed
โ•ฐโ”€> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
modular: error: failed to run python:
19:01:22 root@debian12 ~

โžœ  geek modular install mojo
# Found release for https://packages.modular.com/mojo @ 0.2.1, installing to /home/geek/.modular/pkg/packages.modular.com_mojo

modular: error: failure detected - please run `modular clean` and try again
==========================
Failure Information:
    - http error: failed to reach URL https://cas.modular.com/0/qJUMIUmWIhi1kfcTPvBmcJIJAJ9NkpyZ8kDBK8D2ONE with cURL error SSL connect error - Looking for qJUMIUmWIhi1kfcTPvBmcJIJAJ9NkpyZ8kDBK8D2ONE
==========================

6:49:44 root@debian12 ~ modular install mojo
# Found release for https://packages.modular.com/mojo @ 0.2.1, installing to /root/.modular/pkg/packages.modular.com_mojo
modular: error: failure detected - please run `modular clean` and try again
==========================
Failure Information:
    - Creating symlink for /root/.modular/pkg/packages.modular.com_mojo/lib/liblldb.so.18.0.0git -> /root/.modular/pkg/packages.modular.com_mojo/lib/liblldb.so failed: File exists
    - Creating symlink for /root/.modular/pkg/packages.modular.com_mojo/lib/libMojoJupyter.so.18git -> /root/.modular/pkg/packages.modular.com_mojo/lib/libMojoJupyter.so failed: File exists
    - Creating symlink for /root/.modular/pkg/packages.modular.com_mojo/lib/liblldb.so.18.0.0git -> /root/.modular/pkg/packages.modular.com_mojo/lib/liblldb.so.18git failed: File exists
    - Creating symlink for /root/.modular/pkg/packages.modular.com_mojo/lib/libKGENCompilerRTShared.so.18git -> /root/.modular/pkg/packages.modular.com_mojo/lib/libKGENCompilerRTShared.so failed: File exists
    - Creating symlink for /root/.modular/pkg/packages.modular.com_mojo/lib/libMojoLLDB.so.18git -> /root/.modular/pkg/packages.modular.com_mojo/lib/libMojoLLDB.so failed: File exists
    - Creating symlink for /root/.modular/pkg/packages.modular.com_mojo/lib/libLLCLRuntimeGlobals.so.18git -> /root/.modular/pkg/packages.modular.com_mojo/lib/libLLCLRuntimeGlobals.so failed: File exists
    - Creating symlink for /root/.modular/pkg/packages.modular.com_mojo/lib/libMSupportGlobals.so.18git -> /root/.modular/pkg/packages.modular.com_mojo/lib/libMSupportGlobals.so failed: File exists
    - http error: failed to reach URL https://cas.modular.com/0/UPIL1ruIyvACcPFEhM2zaS07qL6HU8X-WwR5STwZNNc with cURL error SSL connect error - Looking for UPIL1ruIyvACcPFEhM2zaS07qL6HU8X-WwR5STwZNNc
==========================

8:02:33 root@debian12 ~ modular clean && modular auth mut_a27b34525bed433bb61ea88654a814bb &&              130 โ†ต
modular install mojo
# Found release for https://packages.modular.com/mojo @ 0.2.1, installing to /root/.modular/pkg/packages.modular.com_mojo
# Downloads complete, setting configs...
# Configs complete, running post-install hooks...
error: externally-managed-environment

ร— This environment is externally managed
โ•ฐโ”€> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
modular: error: failed to run python:
hhstore commented 1 year ago

1

RickieBlaese commented 1 year ago

Hey, just a heads up. You probably don't want to be posting your personal Modular authentication key here. That's the one that begins with mut_.

hhstore commented 1 year ago

Hey, just a heads up. You probably don't want to be posting your personal Modular authentication key here. That's the one that begins with mut_.

@RickieBlaese

hhstore commented 1 year ago

ๅฎ‰่ฃ…ๆ–นๆกˆ 2๏ผš

ๅฎ‰่ฃ…ๆต็จ‹๏ผš

ๅฎ‰่ฃ… vscode + ๆ’ไปถ๏ผš

ๅŸบไบŽ Dev Containers ๆ’ไปถ๏ผŒ ๅˆ›ๅปบ Ubuntu Docker๏ผš

hhstore commented 1 year ago
image image image image
hhstore commented 1 year ago
image image image
hhstore commented 1 year ago

https://github.com/modularml/mojo/issues/724

hhstore commented 1 year ago

Mojo ๅฎ˜ๆ–นๆ–‡ๆกฃ๏ผŒIntel Mac ๆŽจ่ไฝฟ็”จ Vscode + Dev Containers ๆ’ไปถ + docker ๏ผˆorbstack) ubuntu 22.04 ๅฎนๅ™จ่ฟ™็งๆ–นๅผๅฎ‰่ฃ…๏ผŒ ๆˆ‘ๆต‹่ฏ•ไบ†๏ผŒๆฒก้—ฎ้ข˜ใ€‚

่ฟ™็งๆ–นๅผๅ’Œ orbstack + ubuntu ่™šๆ‹Ÿๆœบ๏ผŒ ๆ•ˆๆžœไธ€ๆ ทใ€‚ ้ƒฝๅฏไปฅ้…ๅˆ vscode + Dev Containers ่ฟžๆŽฅใ€‚

่ฟ™ไธชๆจกๅผๆ˜ฏ vscode ่ฟœ็จ‹่ฟžๆŽฅๆ–นๅผ๏ผŒ ๅฏไปฅ็ปง็ปญๅœจ Ubuntu ๅฎนๅ™จ/่™šๆ‹Ÿๆœบ ไธญ๏ผŒ็ปง็ปญ่ฃ… vscode ็š„ mojo ๆ’ไปถ + copilot๏ผˆGPT) ๆ’ไปถใ€‚

ไฝ“้ชŒๅ’Œๅฎฟไธปๆœบ๏ผŒๅŸบๆœฌๆฒกๅทฎๅˆซใ€‚ไธๆป‘ใ€‚

hhstore commented 1 year ago

image

image

vscode + Dev Containers ๆ’ไปถ๏ผŒๅˆ›ๅปบ็š„ Ubuntu ๅฎนๅ™จ๏ผŒไผš่‡ชๅŠจๅฏๅŠจ่ฟ™ไธชใ€‚

็„ถๅŽ vscode ่ฟœ็จ‹่ฟž่ฟ›่ฟ™ไธชๅฎนๅ™จ๏ผŒ ไปฃ็ ็›ฎๅฝ•๏ผŒๅˆ›ๅปบๅœจ่ฟ™ไธช docker ๅฎนๅ™จ้‡Œ๏ผŒ ๅŸบๆœฌๆ— ็—›ใ€‚

Windows ้…ๅˆ wsl + vscode + Dev Containers ๆ’ไปถ๏ผŒไฝ“้ชŒๅŸบๆœฌๆ˜ฏๅทฎไธๅคš็š„ใ€‚

image