From f7c2d6555f29aa4eae75fa28a8fdf87bf6ef4bb3 Mon Sep 17 00:00:00 2001 From: Weidong Guo Date: Sun, 10 Mar 2024 12:19:42 +0800 Subject: [PATCH] doc: update docs/python.md (#564) when we installed pipenv pkg, we can't run pipenv install command on our local shell, because maybe we didn't have the site-package-bin dir in system $PATH, so we need to add it firstly. --- docs/python.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/python.md b/docs/python.md index 9214773e..ab1056d9 100644 --- a/docs/python.md +++ b/docs/python.md @@ -1851,6 +1851,12 @@ brew upgrade pipenv # homebrew ``` ```shell +# 将 pipenv 命令加入到系统环境变量 $PATH 中 (Unix and MacOS) +dir=$(python -c 'import site; print(site.USER_BASE + "/bin")') # 打印 python site-packages bin 路径 +echo 'export PATH="'$dir':$PATH"' >> ~/.zshrc # 将 dir 路径加入到 PATH 中 +source ~/.zshrc + + # 安装 package pipenv install # 不指定版本 pipenv install == # 精确指定版本