【问题标题】:Why can't I configure my Pip3 installation [duplicate]为什么我不能配置我的 Pip3 安装 [重复]
【发布时间】:2021-06-15 01:16:00
【问题描述】:

我已按照本网站指南 (https://vgkits.org/blog/pip3-config-howto/) 安装 pip3,但是当我进入需要配置 Pip3 安装的步骤时,cmd 终端显示无效语法。

C:\Windows\System32>python
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> pip3 install --user pybin
  File "<stdin>", line 1
    pip3 install --user pybin
               ^
SyntaxError: invalid syntax

【问题讨论】:

标签: python pip


【解决方案1】:

你在 Python shell 中运行这个命令,你应该在普通的命令提示符窗口中运行它。

因为你是windows,用win+r打开运行窗口,输入cmd打开终端窗口。

【讨论】:

    【解决方案2】:

    当您需要从命令行运行代码时,您正在从 Python shell 执行代码。如果你想从 Python shell 安装一个包,这将起作用:

    import pip
    
    pip.main(['install', 'PACKAGE'])
    

    【讨论】:

      猜你喜欢
      • 2021-04-26
      • 1970-01-01
      • 2018-05-14
      • 2021-02-26
      • 2018-02-27
      • 2016-10-11
      • 1970-01-01
      • 1970-01-01
      • 2010-09-30
      相关资源
      最近更新 更多