我不想努力 2022-07-03 16:16 采纳率: 33.3%
浏览 188
已结题

pycharm中无法正常使用pip

问题遇到的现象和发生背景

pycharm安装在D盘无法安装第三方库

问题相关代码,请勿粘贴截图

在解释器中安装报错内容
尝试从系统终端运行此命令。确保使用为 'D:\python\python.exe' 处的 Python 解释器安装的正确版本的 'pip'。


Traceback (most recent call last):
  File "D:\PyCharm\PyCharm 2021.1.1\plugins\python\helpers\packaging_tool.py", line 114, in main
    do_install(pkgs)
  File "D:\PyCharm\PyCharm 2021.1.1\plugins\python\helpers\packaging_tool.py", line 59, in do_install
    run_pip(['install'] + pkgs)
  File "D:\PyCharm\PyCharm 2021.1.1\plugins\python\helpers\packaging_tool.py", line 73, in run_pip
    runpy.run_module(module_name, run_name='__main__', alter_sys=True)
  File "D:\python\lib\runpy.py", line 206, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "D:\python\lib\runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "D:\python\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\python\lib\site-packages\pip\__main__.py", line 29, in <module>
    from pip._internal.cli.main import main as _main
  File "D:\python\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "D:\python\lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "D:\python\lib\site-packages\pip\_internal\cli\main_parser.py", line 8, in <module>
    from pip._internal.cli import cmdoptions
  File "D:\python\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 24, in <module>
    from pip._internal.cli.parser import ConfigOptionParser
  File "D:\python\lib\site-packages\pip\_internal\cli\parser.py", line 12, in <module>
    from pip._internal.configuration import Configuration, ConfigurationError
  File "D:\python\lib\site-packages\pip\_internal\configuration.py", line 20, in <module>
    from pip._internal.exceptions import (
  File "D:\python\lib\site-packages\pip\_internal\exceptions.py", line 14, in <module>
    from pip._vendor.rich.console import Console, ConsoleOptions, RenderResult
  File "D:\python\lib\site-packages\pip\_vendor\rich\console.py", line 46, in <module>
    from ._log_render import FormatTimeCallable, LogRender
  File "D:\python\lib\site-packages\pip\_vendor\rich\_log_render.py", line 5, in <module>
    from .text import Text, TextType
  File "D:\python\lib\site-packages\pip\_vendor\rich\text.py", line 5, in <module>
    from pip._vendor.rich.emoji import EmojiVariant
  File "D:\python\lib\site-packages\pip\_vendor\rich\emoji.py", line 4, in <module>
    from .jupyter import JupyterMixin
  File "D:\python\lib\site-packages\pip\_vendor\rich\jupyter.py", line 4, in <module>
    from .segment import Segment
  File "D:\python\lib\site-packages\pip\_vendor\rich\segment.py", line 19, in <module>
    from .cells import (
  File "D:\python\lib\site-packages\pip\_vendor\rich\cells.py", line 6, in <module>
    from ._lru_cache import LRUCache
  File "D:\python\lib\site-packages\pip\_vendor\rich\_lru_cache.py", line 13, in <module>
    class LRUCache(OrderedDict[CacheKey, CacheValue]):
TypeError: 'type' object is not subscriptable

运行结果及报错内容

在控制台上输入pip install 安装库出现的报错 :SyntaxError: invalid syntax

我的解答思路和尝试过的方法

在cmd中运行pip也是出现如上的报错代码,pip已经更新到最新版并且将pip 的安装目录添加到环境变量中

我想要达到的结果

能够正常使用pip

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 7月11日
    • 创建了问题 7月3日

    悬赏问题

    • ¥15 elasticsearch
    • ¥30 python ttk 获取下拉框问题
    • ¥15 uniapp的uni-datetime-picker组件在ios端不适配
    • ¥15 前端 uniapp App端在离线状态如何使用modbus 连接手机蓝牙进行读写操控机器?
    • ¥15 SQL语句根据字段自动生成行
    • ¥500 “掌声响起来”软件(不确定性人工智能)
    • ¥500 我要找大模型一体机产品手册和应用案例
    • ¥60 用r语言进行数据分析
    • ¥20 关于游戏c++语言代码问题
    • ¥15 如何制作永久二维码,最好是微信也可以扫开的。(相关搜索:管理系统)