# mac 進行 poetry 安裝 :::info 不可使用brew 安裝,因為目前版本為1.1,無法升級至1.2 官網安裝資料如下: https://python-poetry.org/docs/master/ ::: 首先確認Python 版本是否大於3.7 ``` python3 -V ``` 之後按照官網顯示 安裝review版本 ``` curl -sSL https://install.python-poetry.org | POETRY_PREVIEW=1 python3 - ``` 將Poetry's bin directory加入path中 ![](https://i.imgur.com/yh8eAoy.png) 安裝完畢確認poetry 版本 ``` poetry --version ``` fin!😊😊 --- **Install dependencies for local development** `poetry install --with dev` **進入虛擬環境** `poetry shell` --- 錯誤 :::danger Error: `pg_config` executable not found. `pg_config` is in `postgresql-devel` (`libpq-dev` in Debian/Ubuntu, `libpq-devel` on Centos/Fedora/Cygwin/Babun.) ubuntu and Debian: `sudo apt-get install libpq-dev` Centos/Fedora/Cygwin/Babun: `sudo apt-get install libpq-devel` ::: :::danger 如果在安裝yarn時,遇到error 可以先在`npm install --global yarn` 前面加上sudo `sudo npm install --global yarn`,也許是npm沒有拿到權限的問題。 [詳見此鏈結](https://stackoverflow.com/questions/25290986/how-to-fix-eacces-issues-with-npm-install) ::: :::danger 若安裝poetry preview版本時,執行`poetry install --with dev`時,卡在pending,可以先中止程式,將測試版本的下載器關閉`poetry config experimental.new-installer false`,然後再重新執行`poetry install --with dev` :::