Python 3-pip install --user标志找不到安装

时间:2019-05-17 18:20:55

标签: python pipenv

我已经使用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

我是否必须设置路径或其他内容?

1 个答案:

答案 0 :(得分:3)

使用pip3 install标志--user时,会在您的主目录中创建一个隐藏的目录,称为.local。要访问这些可执行文件,我们想将bin添加到我们的路径中。

这应该有效:

export PATH=$PATH:/home/ec2-user/.local/bin