python - PyCharm 无法导入模块
问题描述
我在 Linux 机器上使用 PyCharm。通常,当我导入一个模块时,例如。OpenCV 或 numpy,它工作得很好。但是当我尝试导入 gphoto2 时,出现以下错误。
Collecting gphoto2
Using cached gphoto2-2.2.2.tar.gz (1.9 MB)
DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated. pip 20.3 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.
ERROR: Command errored out with exit status 1:
command: /home/anders/PycharmProjects/pythonProject/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pycharm-packaging/gphoto2/setup.py'"'"'; __file__='"'"'/tmp/pycharm-packaging/gphoto2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-srufwxku
cwd: /tmp/pycharm-packaging/gphoto2/
Complete output (10 lines):
ERROR: command "pkg-config --modversion libgphoto2" failed
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pycharm-packaging/gphoto2/setup.py", line 36, in <module>
cmd, stderr=FNULL, universal_newlines=True).split('.')[:3]
File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/usr/lib/python3.7/subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['pkg-config', '--modversion', 'libgphoto2']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
有人可以帮帮我吗?
解决方案
推荐阅读
- android - 当我将相同的片段添加到第二个导航图时,不识别动作类
- c# - 如何使用 ReactiveUI 观察集合中项目的属性
- c++ - 映射的运算符 [] 无法使用作用域枚举作为键进行编译,但它的 at() 函数有效。为什么会模棱两可?
- html - 将 ASP.Net jquery 更改为可重用/通用函数
- python-3.x - 收到一段代码的错误,但没有收到类似代码段的错误
- android - Android 应用程序在哪里搜索要加载的共享 .so 文件?
- python - 如何从 Chrome DevTools 中找到窗口/iframe
- r - 安装 Rtools 时出现“错误:找不到表”
- android - 使用导航组件时将片段设置为全屏 - Android
- sql - PostgreSQL 如何使用 with as