我为python3安装了pycurl 但是当我想将其导入Pycharm并使用它时,出现以下错误消息:
Traceback (most recent call last):
File "/home/cours/PycharmProjects/untitled2/venv/test.py", line 1, in <module>
import pycurl
ModuleNotFoundError: No module named 'pycurl'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "/home/cours/PycharmProjects/untitled2/venv/test.py", line 1, in <module>
import pycurl
ModuleNotFoundError: No module named 'pycurl'
但是当我使用Pycharm终端(pip install pycurl)安装它时,会收到此消息
Requirement already satisfied: pycurl in /usr/lib/python3/dist-packages (7.43.0.1)
我还已经使用:设置-> Python解释器
导入了该包。最后,我还使用了该项目的“继承全局站点包”选项,并且问题相同
我不知道我还能做什么
答案 0 :(得分:0)
使用命令此命令来安装软件包-
pip3安装pycurl
并在中检查Pycharm python版本以进行代码编译