Mycroft-core: 安装程序 Python 脚本失败。 -- 没有名为“_ctypes”的模块。

创建于 2019-02-03  ·  10评论  ·  资料来源: MycroftAI/mycroft-core

./dev_setup.sh

Processing triggers for sgml-base (1.29) ...
Setting up docbook-xml (4.5-8) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for systemd (232-25+deb9u8) ...
Processing triggers for sgml-base (1.29) ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1603k  100 1603k    0     0  1816k      0 --:--:-- --:--:-- --:--:-- 1816k
Traceback (most recent call last):
  File "<stdin>", line 20649, in <module>
  File "<stdin>", line 197, in main
  File "<stdin>", line 82, in bootstrap
  File "/tmp/tmplfnx9iya/pip.zip/pip/_internal/__init__.py", line 42, in <module>
  File "/tmp/tmplfnx9iya/pip.zip/pip/_internal/cmdoptions.py", line 16, in <module>
  File "/tmp/tmplfnx9iya/pip.zip/pip/_internal/index.py", line 25, in <module>
  File "/tmp/tmplfnx9iya/pip.zip/pip/_internal/download.py", line 39, in <module>
  File "/tmp/tmplfnx9iya/pip.zip/pip/_internal/utils/glibc.py", line 3, in <module>
  File "/usr/local/lib/python3.7/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
Failed to set up virtualenv for mycroft, exiting setup.

树莓派安装。

同样有趣的是,“sgml-base 的处理触发器”被列出了两次。 奇怪的?

最有用的评论

我在这里找到了答案,Zachary Ware 的答案。 我用yum install libffi-dev来修复它。

所有10条评论

在 Raspbian 上,这可以添加到安装脚本中:

Git已经安装好了。 因此,通过 git 将 git repo 下载到“mycroft-core”目录内的“cpython”子目录中:

git clone https://github.com/python/cpython.git

并构建和编译它:

cd cpython

./configure
make -j 4
sudo make altinstall

cd ..

如果未安装 git,(因为此脚本在所有 Linux 上运行),请在git clone之前考虑这一点:
从源安装:
https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

新问题:

编译并安装cpythonstart-mycroft.sh脚本仍然失败,但失败后继续:

Traceback (most recent call last):
  File "<stdin>", line 20649, in <module>
  File "<stdin>", line 197, in main
  File "<stdin>", line 82, in bootstrap
  File "/tmp/tmpy509z2ho/pip.zip/pip/_internal/__init__.py", line 42, in <module>
  File "/tmp/tmpy509z2ho/pip.zip/pip/_internal/cmdoptions.py", line 16, in <module>
  File "/tmp/tmpy509z2ho/pip.zip/pip/_internal/index.py", line 25, in <module>
  File "/tmp/tmpy509z2ho/pip.zip/pip/_internal/download.py", line 39, in <module>
  File "/tmp/tmpy509z2ho/pip.zip/pip/_internal/utils/glibc.py", line 3, in <module>
  File "/usr/local/lib/python3.7/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
Failed to set up virtualenv for mycroft, exiting setup.
start-mycroft.sh:  Mycroft command/service launcher
usage: start-mycroft.sh [COMMAND] [restart] [params]

Services COMMANDs:
  all                      runs core services: bus, audio, skills, voice
  debug                    runs core services, then starts the CLI
  audio                    the audio playback service
  bus                      the messagebus service
  skills                   the skill service
  voice                    voice capture service
  enclosure                mark_1 enclosure service

Tool COMMANDs:
  cli                      the Command Line Interface
  unittest                 run mycroft-core unit tests (requires pytest)
  skillstest               run the skill autotests for all skills (requires pytest)

Util COMMANDs:
  audiotest                attempt simple audio validation
  audioaccuracytest        more complex audio validation
  sdkdoc                   generate sdk documentation

Options:
  restart                  (optional) Force the service to restart if running

Examples:
  start-mycroft.sh all
  start-mycroft.sh all restart
  start-mycroft.sh cli
  start-mycroft.sh unittest

失败后,它就像安装了一样。

尝试使用./start-mycroft.sh debug ,它失败并出现多个错误:

ModuleNotFoundError: No module named '_ctypes'
Failed to set up virtualenv for mycroft, exiting setup.
Starting all mycroft-core services
Initializing...
Starting background service bus
CAUTION: The Mycroft bus is an open websocket with no built-in security
         measures.  You are responsible for protecting the local port
         8181 with a firewall as appropriate.
./start-mycroft.sh: line 140: /var/log/mycroft/bus.log: No such file or directory
Starting background service skills
./start-mycroft.sh: line 140: /var/log/mycroft/skills.log: No such file or directory
Starting background service audio
./start-mycroft.sh: line 140: /var/log/mycroft/audio.log: No such file or directory
Starting background service voice
./start-mycroft.sh: line 140: /var/log/mycroft/voice.log: No such file or directory
Starting background service enclosure
./start-mycroft.sh: line 140: /var/log/mycroft/enclosure.log: No such file or directory
Starting cli
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/pi/Mycroft/mycroft-core/mycroft/__init__.py", line 17, in <module>
    from mycroft.api import Api
  File "/home/pi/Mycroft/mycroft-core/mycroft/api/__init__.py", line 18, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'

猜测你没有使用 picroft,它只是有效。

      Guessing you're not using picroft, which just works.

正确的。 因为我也喜欢在 GUI 环境中用我的 Rpi 做其他事情,而 Picroft 无法正常运行并且没有检测到基本的 USB 麦克风。 没有 GUI 就无法报告错误

这真是一个很奇怪的问题。 好像你设备上的python环境不太好用之类的? _ctypes 包含在用于创建 mycroft virtualenv 的本地 python 标准库中。

能否尝试删除mycroft-core 目录rm -rf .venv.venv文件夹,然后重新运行dev_setup.sh 脚本?

嗨,由于 4 个月没有就这个问题进行沟通,我将关闭它。 如果您仍然遇到此问题,请随时重新打开该问题。

我在这里找到了答案,Zachary Ware 的答案。 我用yum install libffi-dev来修复它。

我在这里找到了答案,Zachary Ware 的答案。 我用yum install libffi-dev来修复它。

是的,这对我有用,我确保这些软件包安装在我的 Centos 7 上:

sudo yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel expat-devel libffi-dev gcc gcc-c++ zlib libffi-devel

然后重新安装我的python 3.8.1:

wget http://python.org/ftp/python/3.6.8/Python-3.6.8.tar.xz

tar xf Python-3.6.8.tar.xz

cd Python-3.6.8

./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"

make && make altinstall

然后我终于能够安装docker-compose:

pip3.8 install docker-compose

谢谢@grosshen

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

tiagochiavericosta picture tiagochiavericosta  ·  6评论

tmajibon picture tmajibon  ·  9评论

ryanleesipes picture ryanleesipes  ·  4评论

krisgesling picture krisgesling  ·  3评论

Ahmed-Benj picture Ahmed-Benj  ·  7评论