Python 包。未在 IntelliJ Idea(社区版)上安装 - 属性错误

问题描述 投票:0回答:1

我使用的是 IntelliJ Idea Community 2022.2,使用 JetBrains 的 Python 社区版插件。我想安装

mysql-connector-python
软件包。我从 IDE 自己的 Python 包部分尝试了它,但它以错误结束,如下所示

afeIndex = self.tree.openElements.i(formattingElement)
               ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'i'

IDE 告诉您在终端中运行以下命令。它表明如果这个命令也不起作用,那么问题就超出了 IDE 的控制范围。它也给出了同样的错误。

C:\Users\SK\IdeaProjects\Python_Learn\venv\Scripts\activate.bat
C:/Users/SK/IdeaProjects/Python_Learn/venv/Scripts/python.exe C:/Users/SK/AppData/Roaming/JetBrains/IdeaIC2024.1/plugins/python-ce/helpers/packaging_tool.py install mysql-connector-python

这不仅适用于该特定软件包,而且我尝试安装的任何软件包都显示完全相同的错误。我去了PyCharm Troubleshooting Guide(按照IDE的建议),但什么也没找到,然后也更新到最新的Community 2024.1,但问题还是一样。

毕竟我在终端中尝试了简单的

pip
命令来安装该软件包,令我惊讶的是它确实有效,该软件包也被 Idea 识别了。那为什么用Idea安装包时只会出现这个错误呢?

python-3.x intellij-idea attributeerror python-packaging
1个回答
0
投票

您使用的Python版本是什么?

© www.soinside.com 2019 - 2024. All rights reserved.