Python 3 - pip install --user 标志找不到安装
Python 3 - pip install --user flag can't find installs
我已经使用 pip3 安装了 pipenv,但是当我尝试 运行 时找不到它。
以下是我安装 pipenv 的方式:
[ec2-user@ip-xxx-xx-xx-xxx newslookup]$ pip3 install pipenv --user
Collecting pipenv
Using cached https://files.pythonhosted.org/packages/13/b4/3ffa55f77161cff9a5220f162670f7c5eb00df52e00939e203f601b0f579/pipenv-2018.11.26-py3-none-any.whl
Requirement already satisfied: virtualenv in /home/ec2-user/.local/lib/python3.7/site-packages (from pipenv)
Requirement already satisfied: pip>=9.0.1 in /usr/lib/python3.7/site-packages (from pipenv)
Requirement already satisfied: virtualenv-clone>=0.2.5 in /home/ec2-user/.local/lib/python3.7/site-packages (from pipenv)
Requirement already satisfied: certifi in /home/ec2-user/.local/lib/python3.7/site-packages (from pipenv)
Requirement already satisfied: setuptools>=36.2.1 in /usr/lib/python3.7/site-packages (from pipenv)
Installing collected packages: pipenv
Successfully installed pipenv-2018.11.26
如你所见,安装成功。
这是我尝试 运行 我的 python 文件时发生的情况:
[ec2-user@ip-172-31-90-218 newslookup]$ pipenv run python nasdaq_scrape_sec.py
-bash: /usr/bin/pipenv: No such file or directory
我必须设置路径还是什么?
当您 pip3 install
使用 --user
标志时,会在您的主目录中创建一个名为 .local
的隐藏目录。要访问这些可执行文件,我们要将 bin 添加到我们的路径中。
这应该有效:
export PATH=$PATH:/home/ec2-user/.local/bin
我已经使用 pip3 安装了 pipenv,但是当我尝试 运行 时找不到它。
以下是我安装 pipenv 的方式:
[ec2-user@ip-xxx-xx-xx-xxx newslookup]$ pip3 install pipenv --user
Collecting pipenv
Using cached https://files.pythonhosted.org/packages/13/b4/3ffa55f77161cff9a5220f162670f7c5eb00df52e00939e203f601b0f579/pipenv-2018.11.26-py3-none-any.whl
Requirement already satisfied: virtualenv in /home/ec2-user/.local/lib/python3.7/site-packages (from pipenv)
Requirement already satisfied: pip>=9.0.1 in /usr/lib/python3.7/site-packages (from pipenv)
Requirement already satisfied: virtualenv-clone>=0.2.5 in /home/ec2-user/.local/lib/python3.7/site-packages (from pipenv)
Requirement already satisfied: certifi in /home/ec2-user/.local/lib/python3.7/site-packages (from pipenv)
Requirement already satisfied: setuptools>=36.2.1 in /usr/lib/python3.7/site-packages (from pipenv)
Installing collected packages: pipenv
Successfully installed pipenv-2018.11.26
如你所见,安装成功。
这是我尝试 运行 我的 python 文件时发生的情况:
[ec2-user@ip-172-31-90-218 newslookup]$ pipenv run python nasdaq_scrape_sec.py
-bash: /usr/bin/pipenv: No such file or directory
我必须设置路径还是什么?
当您 pip3 install
使用 --user
标志时,会在您的主目录中创建一个名为 .local
的隐藏目录。要访问这些可执行文件,我们要将 bin 添加到我们的路径中。
这应该有效:
export PATH=$PATH:/home/ec2-user/.local/bin