---
# System prepended metadata

title: '**如何安裝 Genie 環境 標準版**'

---

# **如何安裝 Genie 環境 標準版**

---

## Genie 官網教學網址

**連結 :** https://wiki.almond.stanford.edu/en/genie-guide/setup

![](https://i.imgur.com/LrkH7EA.png)

---

## **我的安裝環境設定**

* **主機系統 : Windows 11**
* **虛擬機 : VMware workstation 17**
* **作業系統 : Ubuntu 20.04**


---
# Node.js 安裝 指定版本 node 18.12.1



## Node.js 版本管理和安裝

如果 Ubuntu 是新建立的請輸入以下指令安裝 curl，如果已經裝過可以跳過
```
sudo apt install curl
```

要安裝或更新nvm的安裝腳本
```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
```

源代碼行添加到正確的配置文件

```
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
```
安裝 node 18.12.1
```
nvm install v18.12.1
```
檢查版本是否正確
```
node -v
```
npm 安裝(./install_components.sh 需要)
```
sudo apt-get install npm
```
更新 npm
```
npm install latest
```
```
npm audit fix
```

---

# Git 安裝

```
sudo apt-get update
sudo apt-get install git-all
git version

```

# pip3 安裝
## 安裝不同版本的 Python 必定導致 Ubuntu 的 CMD 無法開啟，所以採用 Ubuntu 預設的 Python 版本，不要裝其他 Python !
```
sudo apt install python3-pip -y
```

# Genie SDK 開始安裝

先從 Git 下載 SDK
```
git clone https://github.com/stanford-oval/genie-sdk
cd genie-sdk
chmod 777 install_deps.sh
chmod 777 install_components.sh
./install_deps.sh
```
Source the profile file.
```
source ~/.bashrc
```
安裝 genienlp
```
pip3 install genienlp==0.7.0a4.
```
載入 Genie 元件
```
./install_components.sh
```

![](https://i.imgur.com/wcqeBYP.png)

# 更新

https://brew.sh/index_zh-tw
```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
https://linux.how2shout.com/how-to-install-brew-ubuntu-20-04-lts-linux/


https://podman.io/getting-started/installation



---

ERROR: datasets 2.5.2 has requirement dill<0.3.6, but you'll have dill 0.3.6 which is incompatible.

```
pip3 install dill==0.3.6

```


---

```
pip install numpy==1.19.0
```

```
npm ERR! code EUSAGE
npm ERR! 
npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm ERR! 
npm ERR! Invalid: lock file's node-gyp@3.8.0 does not satisfy node-gyp@7.1.2
npm ERR! Missing: env-paths@2.2.1 from lock file
npm ERR! Invalid: lock file's nopt@3.0.6 does not satisfy nopt@5.0.0
npm ERR! Invalid: lock file's tar@2.2.2 does not satisfy tar@6.1.14
npm ERR! Missing: node-gyp@3.8.0 from lock file
npm ERR! Missing: chownr@2.0.0 from lock file
npm ERR! Missing: fs-minipass@2.1.0 from lock file
npm ERR! Missing: minipass@5.0.0 from lock file
npm ERR! Missing: minizlib@2.1.2 from lock file
npm ERR! Missing: mkdirp@1.0.4 from lock file
npm ERR! Missing: nopt@3.0.6 from lock file
npm ERR! Missing: rimraf@2.7.1 from lock file
npm ERR! Missing: semver@5.3.0 from lock file
npm ERR! Missing: tar@2.2.2 from lock file
npm ERR! Missing: which@1.3.1 from lock file
npm ERR! Missing: minipass@3.3.6 from lock file
npm ERR! Missing: minipass@3.3.6 from lock file
npm ERR! 
npm ERR! Clean install a project
npm ERR! 
npm ERR! Usage:
npm ERR! npm ci
npm ERR! 
npm ERR! Options:
npm ERR! [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
npm ERR! [-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
npm ERR! [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm ERR! [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
npm ERR! [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm ERR! [-ws|--workspaces] [--include-workspace-root] [--install-links]
npm ERR! 
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR! 
npm ERR! Run "npm help ci" for more info

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/wang/.npm/_logs/2023-05-15T17_20_30_114Z-debug-0.log

```

```
+ test -d workdir
+ node --experimental_worker ./genie-toolkit/dist/tool/genie.js init-project --developer-key 88c03add145ad3a3aa4074ffa828be5a391625f9d4e1d0b034b445f18c595656 workdir
Initializing Git repository...
'git' 'init'
Initialized empty Git repository in /home/wang/genie-sdk/workdir/.git/
'git' 'config' 'thingpedia.url' 'https://thingpedia.stanford.edu/thingpedia'
'git' 'config' 'thingpedia.developer-key' '88c03add145ad3a3aa4074ffa828be5a391625f9d4e1d0b034b445f18c595656'
Copying skeleton code...
Writing metadata...
Installing dependencies...
'npm' 'install'
npm ERR! code ETARGET
npm ERR! notarget No matching version found for genie-toolkit@^0.10.1-alpha.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/wang/.npm/_logs/2023-05-15T17_27_14_614Z-debug-0.log
/home/wang/genie-sdk/genie-toolkit/dist/tool/genie.js:45
    throw up;
    ^

Error: Command exited with code 1
    at ChildProcess.<anonymous> (/home/wang/genie-sdk/genie-toolkit/dist/lib/utils/process-utils.js:95:28)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
```
![](https://hackmd.io/_uploads/HJNjBX6H3.png)

```
pip install starlette
```
![](https://hackmd.io/_uploads/SJfWUX6Bn.png)

```
pip install uvicorn
```