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.

有人可以帮我吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...