我在终端中运行了以下命令(我在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或命令运行的方式有关。
第二,我很好奇为什么不使用python3不能使用pip,为什么不使用python3不能使用pip3,但是将其与python3一起使用却失败。我知道这可能与系统的配置方式有关,但是我正在尝试如何最好地配置系统以满足我的需求。
答案 0 :(得分:0)
pip3是python 3版本,pip用于python2.7(已不再可用)。您的警告来自您的路径不匹配。 https://www.educative.io/edpresso/how-to-add-python-to-the-path-variable-in-mac将有助于更好地解释它。
尝试: get_pip.py
由于安装了python 3,对吗?尝试cd到保存python 3的目录,然后运行get_pip.py。然后使用python3 get_pip.py运行文件。这应该在您的计算机上安装了pip3。
我也很难在Mac上第一次使用它,但是上面的方法对我来说很好。