【问题标题】:Installing cwiid with Python 3 extension使用 Python 3 扩展安装 cwiid
【发布时间】:2019-06-24 22:19:46
【问题描述】:

我正在尝试下载并安装带有 Raspberry Pi 3B+ 扩展名的 cwiid 包。但我不断收到这个错误。

pi@raspberrypi:~ $ sudo pip3 install cwiid
Collecting cwiid
  Downloading https://files.pythonhosted.org/packages/fa/e8/d0f03c60bbdc583a7fa37a126e9b20055fb3752861820c25bd212dc62756/cwiid-3.0.0.tar.gz
Building wheels for collected packages: cwiid
  Running setup.py bdist_wheel for cwiid ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pr2tdgci/cwiid/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpawo66t7jpip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_ext
  building 'cwiid' extension
  creating build
  creating build/temp.linux-armv7l-3.5
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6waWnr/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c cwiidmodule.c -o build/temp.linux-armv7l-3.5/cwiidmodule.o
  cwiidmodule.c:27:19: fatal error: cwiid.h: No such file or directory
   #include <cwiid.h>
                     ^
  compilation terminated.
  error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for cwiid
  Running setup.py clean for cwiid
Failed to build cwiid
Installing collected packages: cwiid
  Running setup.py install for cwiid ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pr2tdgci/cwiid/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-3twbm9c7-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'cwiid' extension
    creating build
    creating build/temp.linux-armv7l-3.5
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6waWnr/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c cwiidmodule.c -o build/temp.linux-armv7l-3.5/cwiidmodule.o
    cwiidmodule.c:27:19: fatal error: cwiid.h: No such file or directory
     #include <cwiid.h>
                       ^
    compilation terminated.
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pr2tdgci/cwiid/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-3twbm9c7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-pr2tdgci/

任何想法我做错了什么?我确实研究了这个主题,并在 github 上发现了一些关于 Python 3 扩展的聊天,但它涵盖了不同的错误消息。

编辑: 我在 pip 命令之前运行 sudo apt-get install libcwiid1 libcwiid1-dev 但收到以下错误消息

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libcwiid1-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libcwiid-dev

E: Package 'libcwiid1-dev' has no installation candidate

我认为这是最初的问题来自?

【问题讨论】:

    标签: python-3.x raspberry-pi wiimote


    【解决方案1】:

    您似乎缺少 cwiid 标头。尝试使用安装它们

    sudo apt-get install libcwiid1 libcwiid1-dev

    然后重新运行您的 pip3 命令。

    【讨论】:

    • 我在尝试 pip 之前确实运行了这些。只需将我为他们收到的错误消息放在原始帖子中即可
    • 如果将libcwiid1-dev 替换为libcwiid-dev 会怎样?
    • 使用 libcwiid-dev 运行良好,谢谢!现在我这里提到了另一个问题github.com/azzra/python3-wiimote/issues/7,但我不明白如何像建议的那样更改行
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-19
    • 1970-01-01
    • 2020-05-14
    • 2010-09-23
    • 2011-12-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多