【发布时间】:2020-09-04 20:59:50
【问题描述】:
我在终端中运行了以下命令(我在 MacOs Catalina 上运行):
pip3 install pipenv
我收到了最终日志
WARNING: The script virtualenv-clone is installed in '/Users/rubenolmos/Library/Python/3.7/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script virtualenv is installed in '/Users/rubenolmos/Library/Python/3.7/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts pipenv and pipenv-resolver are installed in '/Users/rubenolmos/Library/Python/3.7/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed appdirs-1.4.4 certifi-2020.6.20 distlib-0.3.1 filelock-3.0.12 importlib-metadata-1.7.0 pipenv-2020.8.13 virtualenv-20.0.31 virtualenv-clone-0.5.4 zipp-3.1.0
这是我的第一台 Mac。我有几个问题:我无法使用 pip 运行命令,只能使用 pip3 运行它。我以这种格式运行它是不是很糟糕。当我尝试运行命令时:
python3 -m pip3 install pipenv
我收到模块 pip3 无法识别的错误,但是当我运行以下命令时:
python3 -m pip install pipenv
我得到以下输出
Requirement already satisfied: pipenv in ./Library/Python/3.7/lib/python/site-packages (2020.8.13)
Requirement already satisfied: certifi in ./Library/Python/3.7/lib/python/site-packages (from pipenv) (2020.6.20)
Requirement already satisfied: virtualenv in ./Library/Python/3.7/lib/python/site-packages (from pipenv) (20.0.31)
Requirement already satisfied: pip>=18.0 in ./Library/Python/3.7/lib/python/site-packages (from pipenv) (20.2.2)
Requirement already satisfied: virtualenv-clone>=0.2.5 in ./Library/Python/3.7/lib/python/site-packages (from pipenv) (0.5.4)
Requirement already satisfied: setuptools>=36.2.1 in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages (from pipenv) (40.8.0)
Requirement already satisfied: importlib-metadata<2,>=0.12; python_version < "3.8" in ./Library/Python/3.7/lib/python/site-packages (from virtualenv->pipenv) (1.7.0)
Requirement already satisfied: six<2,>=1.9.0 in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages (from virtualenv->pipenv) (1.12.0)
Requirement already satisfied: appdirs<2,>=1.4.3 in ./Library/Python/3.7/lib/python/site-packages (from virtualenv->pipenv) (1.4.4)
Requirement already satisfied: filelock<4,>=3.0.0 in ./Library/Python/3.7/lib/python/site-packages (from virtualenv->pipenv) (3.0.12)
Requirement already satisfied: distlib<1,>=0.3.1 in ./Library/Python/3.7/lib/python/site-packages (from virtualenv->pipenv) (0.3.1)
Requirement already satisfied: zipp>=0.5 in ./Library/Python/3.7/lib/python/site-packages (from importlib-metadata<2,>=0.12; python_version < "3.8"->virtualenv->pipenv) (3.1.0)
首先,我想确切地了解警告是什么,更重要的是,它为什么会发生。我感觉它与使用的 pip 或命令运行的方式有关。
其次,我很好奇为什么 pip 不使用 python3 就不能工作,为什么 pip3 不使用 python3 可以工作,但是当它与 python3 一起使用时会失败。我知道这可能与我的系统配置方式有关,但我正在尝试如何最好地配置我的系统以满足我的需求。
【问题讨论】:
标签: python-3.x terminal pip virtualenv