Python, why it must be you Python?

I have a Pi 4. I was certain I could just easily install Mycroft, but, well, already at the installation thing are starting to go wrong: “_ciffi_backhand” looks missing, and going further does nothing: “inflection” is missing. I’ve installed Inflection via pip and it stiss says it’s missing, and Ciffi just isn’t found. On top of that, I have the latest version of pip installed, but dev_setup.sh insists that it’s running on 20.0.2.

Sure, I could just use Picroft, but I already have a lot going on with that Pi and I’d rather not restart from scratch. Using another Pi is not an option.

Did you start the venv before running pip?

It would be useful to see what you’re seeing in more detail (e.g. when do you see the errors? at startup, during install?) FWIW, a “dev_setup.sh” install on stock latest-raspberrypios, it finishes fine for me.

I did indeed run virtualenv venv, but it did nothing.

I’ve already specified it: _ciffi_backhand missing and pip 20.0.2 while running dev_setup.sh, inflection missing everywhere else.

We’re looking for a more complete list of commands that you ran to get to that point. Pip freeze wouldn’t be bad either from within the venv and from the system.

The pip freeze output:
appdirs==1.4.4
asn1crypto==0.24.0
automationhat==0.2.0
bcrypt==3.2.0
beautifulsoup4==4.7.1
blinker==1.4
blinkt==0.1.2
buttonshim==0.0.2
Cap1xxx==0.1.3
certifi==2018.8.24
cffi==1.14.5
chardet==3.0.4
Click==7.0
colorama==0.3.7
colorzero==1.1
cookies==2.2.1
cryptography==2.6.1
distlib==0.3.2
drumhat==0.1.0
entrypoints==0.3
envirophat==1.0.0
ExplorerHAT==0.4.2
filelock==3.0.12
Flask==1.0.2
fourletterphat==0.1.0
gpiozero==1.6.2
greenlet==0.4.15
html5lib==1.0.1
idna==2.6
importlib-metadata==4.5.0
inflection==0.5.1
itsdangerous==0.24
Jinja2==2.10
keyring==17.1.1
keyrings.alt==3.1.1
lxml==4.3.2
MarkupSafe==1.1.0
microdotphat==0.2.1
mote==0.0.4
motephat==0.0.3
msgpack==0.5.6
neovim==0.3.0
numpy==1.16.2
oauthlib==2.1.0
olefile==0.46
pantilthat==0.0.7
paramiko==2.7.2
phatbeat==0.1.1
pianohat==0.1.0
picamera==1.13
piglow==1.2.5
pigpio==1.78
Pillow==5.4.1
psutil==5.5.1
pycparser==2.20
pycrypto==2.6.1
PyGObject==3.30.4
pyinotify==0.9.6
PyJWT==1.7.0
PyNaCl==1.4.0
pyOpenSSL==19.0.0
pyserial==3.4
python-apt==1.8.4.3
pyxattr==0.6.1
pyxdg==0.25
rainbowhat==0.1.0
requests==2.21.0
requests-oauthlib==1.0.0
responses==0.9.0
RPi.GPIO==0.7.0
RTIMULib==7.2.1
scrollphat==0.0.7
scrollphathd==1.2.1
SecretStorage==2.3.1
sense-hat==2.2.0
simplejson==3.16.0
six==1.12.0
skywriter==0.0.7
sn3218==1.2.7
soupsieve==1.8
spidev==3.5
ssh-import-id==5.7
touchphat==0.0.1
twython==3.7.0
typing-extensions==3.10.0.0
unicornhathd==0.0.4
urllib3==1.24.1
virtualenv==20.4.7
webencodings==0.5.1
Werkzeug==0.14.1
zipp==3.4.1

I haven’t done much of anything python related because on that Raspberry prior to trying to install Mycroft (no idea how much Apache and Postfix use Python).
For which it went pretty much like this:
bash dev_setup.sh [_ciffi_backend is missing, still gets to the end]
./start-mycroft.sh all [doesn’t return any error, but nothing actually works]
./start-mycroft.sh unittest [inflection missing]
Tried to install both inflection and cffi, Inflection installed, cffi isn’t found.
Repeated the installation process, same as the previous time.
Repeated after changing the symlink to linkpython to python3 instead to python2, redone the installation process, same thing.
Retried after running virtualenv venv, copy-paste as the very first time.

cffi doesn’t come from pip. It’s generally provided via a distro package.

I’m not in a position to check the Raspbian repos atm, but on Manjaro, I’m seeing python-cffi, and on Debian I’m seeing python3-cffi.

I’ve checked and that’s installed as well.
No idea why dev_setup.sh says it’s missing.

I’ve just realized:

I did indeed run virtualenv venv, but it did nothing.

That’s how you’d create a venv using virtualenv, but doesn’t tell us if you’re in one (or the right one.) dev_setup.sh creates Mycroft’s venv early on. If you never saw output informing you that it failed to create the venv, it created one, and you created a different one.

Basically, I think you’re installing these deps in the wrong sandbox, but that could be wrong.

This would be much easier to diagnose with the actual output. A summary of what happened is hard to work with because we’d have to experience the same problem to know exactly what would cause it.

Here’s the exact output:

pi@raspberrypi:~/mycroft-core $ sudo apt install cffi-backend
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze
Lettura informazioni sullo stato... Fatto
E: Impossibile trovare il pacchetto cffi-backend
pi@raspberrypi:~/mycroft-core $ bash dev_setup.sh
Installing packages...
 Installing packages for Debian/Ubuntu/Mint...
Reading package lists... Done
Building dependency tree
Reading state information... Done
autoconf is already the newest version (2.69-11).
automake is already the newest version (1:1.16.1-4).
bison is already the newest version (2:3.3.2.dfsg-1).
build-essential is already the newest version (12.6).
curl is already the newest version (7.64.0-4+deb10u2).
flac is already the newest version (1.3.2-3).
git is already the newest version (1:2.20.1-2+deb10u3).
jq is already the newest version (1.5+dfsg-2+b1).
libfann-dev is already the newest version (2.2.0+ds-5).
libffi-dev is already the newest version (3.2.1-9).
libglib2.0-dev is already the newest version (2.58.3-2+deb10u2).
libicu-dev is already the newest version (63.1-6+deb10u1).
libjpeg-dev is already the newest version (1:1.5.2-2+deb10u1).
libtool is already the newest version (2.4.6-9).
mpg123 is already the newest version (1.25.10-2).
pkg-config is already the newest version (0.29-6).
portaudio19-dev is already the newest version (19.6.0-1+deb10u1).
python3 is already the newest version (3.7.3-1).
python3-dev is already the newest version (3.7.3-1).
python3-setuptools is already the newest version (40.8.0-1).
screen is already the newest version (4.6.2-3+deb10u1).
swig is already the newest version (3.0.12-2).
libssl-dev is already the newest version (1.1.1d-0+deb10u6+rpt1).
pulseaudio is already the newest version (12.2-4+deb10u1+rpi3).
pulseaudio-utils is already the newest version (12.2-4+deb10u1+rpi3).
The following package was automatically installed and is no longer required:
  python-colorzero
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1892k  100 1892k    0     0  3646k      0 --:--:-- --:--:-- --:--:-- 3639k
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pip==20.0.2
  Using cached https://www.piwheels.org/simple/pip/pip-20.0.2-py2.py3-none-any.whl (1.4 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.0.2
    Uninstalling pip-20.0.2:
      Successfully uninstalled pip-20.0.2
Successfully installed pip-20.0.2
WARNING: You are using pip version 20.0.2; however, version 21.1.2 is available.
You should consider upgrading via the '/home/pi/mycroft-core/.venv/bin/python -m pip install --upgrade pip' command.
Installing PEP8 check as precommit-hook
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: requests<2.26.0,>=2.20.0 in ./.venv/lib/python3.7/site-packages (from -r requirements/requirements.txt (line 1)) (2.25.1)
Collecting gTTS<2.3.0,>=2.2.2
  Using cached gTTS-2.2.2-py3-none-any.whl (25 kB)
Collecting PyAudio==0.2.11
  Using cached PyAudio-0.2.11.tar.gz (37 kB)
Collecting pyee==8.1.0
  Using cached pyee-8.1.0-py2.py3-none-any.whl (12 kB)
Collecting SpeechRecognition==3.8.1
  Using cached SpeechRecognition-3.8.1-py2.py3-none-any.whl (32.8 MB)
Collecting tornado==6.0.3
  Using cached tornado-6.0.3.tar.gz (482 kB)
Collecting websocket-client==0.54.0
  Using cached websocket_client-0.54.0-py2.py3-none-any.whl (200 kB)
Collecting requests-futures==0.9.5
  Using cached https://www.piwheels.org/simple/requests-futures/requests_futures-0.9.5-py3-none-any.whl (6.7 kB)
Collecting pyserial==3.0
  Using cached https://www.piwheels.org/simple/pyserial/pyserial-3.0-py3-none-any.whl (87 kB)
Collecting psutil==5.6.6
  Using cached psutil-5.6.6.tar.gz (447 kB)
Collecting pocketsphinx==0.1.0
  Using cached pocketsphinx-0.1.0.tar.gz (503 kB)
Collecting inflection==0.3.1
  Using cached https://www.piwheels.org/simple/inflection/inflection-0.3.1-py3-none-any.whl (6.9 kB)
Collecting pillow==8.1.1
  Using cached Pillow-8.1.1-cp37-cp37m-manylinux2014_aarch64.whl (2.2 MB)
Collecting python-dateutil==2.6.0
  Using cached python_dateutil-2.6.0-py2.py3-none-any.whl (194 kB)
Collecting fasteners==0.14.1
  Using cached fasteners-0.14.1-py2.py3-none-any.whl (20 kB)
Collecting PyYAML==5.4
  Using cached PyYAML-5.4.tar.gz (174 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting lingua-franca==0.4.1
  Using cached lingua_franca-0.4.1-py3-none-any.whl (578 kB)
Collecting msm==0.8.9
  Using cached msm-0.8.9-py3-none-any.whl (25 kB)
Collecting msk==0.3.16
  Using cached msk-0.3.16-py3-none-any.whl (47 kB)
Collecting mycroft-messagebus-client==0.9.1
  Using cached mycroft_messagebus_client-0.9.1-py3-none-any.whl (18 kB)
Collecting adapt-parser==0.3.7
  Using cached https://www.piwheels.org/simple/adapt-parser/adapt_parser-0.3.7-py3-none-any.whl (23 kB)
Collecting padatious==0.4.8
  Using cached https://www.piwheels.org/simple/padatious/padatious-0.4.8-py2.py3-none-any.whl (24 kB)
Collecting fann2==1.0.7
  Using cached fann2-1.0.7.tar.gz (63 kB)
Collecting padaos==0.1.9
  Using cached https://www.piwheels.org/simple/padaos/padaos-0.1.9-py3-none-any.whl (3.1 kB)
Collecting precise-runner==0.2.1
  Using cached https://www.piwheels.org/simple/precise-runner/precise_runner-0.2.1-py3-none-any.whl (5.2 kB)
Collecting petact==0.1.2
  Using cached https://www.piwheels.org/simple/petact/petact-0.1.2-py3-none-any.whl (4.3 kB)
Collecting pyxdg==0.26
  Using cached pyxdg-0.26-py2.py3-none-any.whl (40 kB)
Requirement already satisfied: chardet<5,>=3.0.2 in ./.venv/lib/python3.7/site-packages (from requests<2.26.0,>=2.20.0->-r requirements/requirements.txt (line 1)) (4.0.0)
Requirement already satisfied: idna<3,>=2.5 in ./.venv/lib/python3.7/site-packages (from requests<2.26.0,>=2.20.0->-r requirements/requirements.txt (line 1)) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in ./.venv/lib/python3.7/site-packages (from requests<2.26.0,>=2.20.0->-r requirements/requirements.txt (line 1)) (2021.5.30)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./.venv/lib/python3.7/site-packages (from requests<2.26.0,>=2.20.0->-r requirements/requirements.txt (line 1)) (1.26.5)
Requirement already satisfied: six in ./.venv/lib/python3.7/site-packages (from gTTS<2.3.0,>=2.2.2->-r requirements/requirements.txt (line 2)) (1.16.0)
Collecting click
  Using cached click-8.0.1-py3-none-any.whl (97 kB)
Collecting monotonic>=0.1
  Using cached monotonic-1.6-py2.py3-none-any.whl (8.2 kB)
Collecting GitPython
  Using cached GitPython-3.1.17-py3-none-any.whl (166 kB)
Collecting pako
  Using cached pako-0.3.1-py3-none-any.whl (16 kB)
Collecting lazy
  Using cached lazy-1.4-py2.py3-none-any.whl (6.2 kB)
Requirement already satisfied: colorama in ./.venv/lib/python3.7/site-packages (from msk==0.3.16->-r requirements/requirements.txt (line 20)) (0.4.4)
Collecting pygithub
  Using cached PyGithub-1.55-py3-none-any.whl (291 kB)
Collecting xxhash
  Using cached xxhash-2.0.2-cp37-cp37m-manylinux2014_aarch64.whl (241 kB)
Requirement already satisfied: importlib-metadata; python_version < "3.8" in ./.venv/lib/python3.7/site-packages (from click->gTTS<2.3.0,>=2.2.2->-r requirements/requirements.txt (line 2)) (4.5.0)
Requirement already satisfied: typing-extensions>=3.7.4.0; python_version < "3.8" in ./.venv/lib/python3.7/site-packages (from GitPython->msm==0.8.9->-r requirements/requirements.txt (line 19)) (3.10.0.0)
Collecting gitdb<5,>=4.0.1
  Using cached gitdb-4.0.7-py3-none-any.whl (63 kB)
Collecting appdirs
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting deprecated
  Using cached Deprecated-1.2.12-py2.py3-none-any.whl (9.5 kB)
Collecting pynacl>=1.4.0
  Using cached PyNaCl-1.4.0.tar.gz (3.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: /home/pi/mycroft-core/.venv/bin/python /home/pi/mycroft-core/.venv/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmppaz8gghk
         cwd: /tmp/pip-install-y6qjciu7/pynacl
    Complete output (36 lines):
    Traceback (most recent call last):
      File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 257, in <module>
        main()
      File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 240, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 110, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/tmp/pip-build-env-s4sdqku8/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 166, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "/tmp/pip-build-env-s4sdqku8/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 150, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 264, in <module>
        "Programming Language :: Python :: 3.8",
      File "/tmp/pip-build-env-s4sdqku8/overlay/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.7/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/tmp/pip-build-env-s4sdqku8/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 456, in __init__
        k: v for k, v in attrs.items()
      File "/usr/lib/python3.7/distutils/dist.py", line 292, in __init__
        self.finalize_options()
      File "/tmp/pip-build-env-s4sdqku8/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 801, in finalize_options
        ep(self)
      File "/tmp/pip-build-env-s4sdqku8/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 808, in _finalize_setup_keywords
        ep.load()(self, ep.name, value)
      File "/tmp/pip-build-env-s4sdqku8/overlay/lib/python3.7/site-packages/cffi/setuptools_ext.py", line 219, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/tmp/pip-build-env-s4sdqku8/overlay/lib/python3.7/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/tmp/pip-build-env-s4sdqku8/overlay/lib/python3.7/site-packages/cffi/setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "src/bindings/build.py", line 36, in <module>
        ffi = FFI()
      File "/tmp/pip-build-env-s4sdqku8/overlay/lib/python3.7/site-packages/cffi/api.py", line 48, in __init__
        import _cffi_backend as backend
    ModuleNotFoundError: No module named '_cffi_backend'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/pi/mycroft-core/.venv/bin/python /home/pi/mycroft-core/.venv/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmppaz8gghk Check the logs for full command output.
WARNING: You are using pip version 20.0.2; however, version 21.1.2 is available.
You should consider upgrading via the '/home/pi/mycroft-core/.venv/bin/python -m pip install --upgrade pip' command.
Warning: Failed to install required dependencies. Continue? y/N
y
WARNING: You are using pip version 20.0.2; however, version 21.1.2 is available.
You should consider upgrading via the '/home/pi/mycroft-core/.venv/bin/python -m pip install --upgrade pip' command.
WARNING: You are using pip version 20.0.2; however, version 21.1.2 is available.
You should consider upgrading via the '/home/pi/mycroft-core/.venv/bin/python -m pip install --upgrade pip' command.
WARNING: You are using pip version 20.0.2; however, version 21.1.2 is available.
You should consider upgrading via the '/home/pi/mycroft-core/.venv/bin/python -m pip install --upgrade pip' command.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting git+https://github.com/behave/behave@v1.2.7.dev1 (from -r requirements/tests.txt (line 8))
  Cloning https://github.com/behave/behave (to revision v1.2.7.dev1) to /tmp/pip-req-build-yzbxnda2
  Running command git clone -q https://github.com/behave/behave /tmp/pip-req-build-yzbxnda2
  Running command git checkout -q 4e73cabf1b2445b3c1ab6b3aed14424d32d140ac
Requirement already satisfied (use --upgrade to upgrade): behave==1.2.7.dev1 from git+https://github.com/behave/behave@v1.2.7.dev1 in ./.venv/lib/python3.7/site-packages (from -r requirements/tests.txt (line 8))
Requirement already satisfied: coveralls==1.8.2 in ./.venv/lib/python3.7/site-packages (from -r requirements/tests.txt (line 1)) (1.8.2)
Requirement already satisfied: flake8==3.7.9 in ./.venv/lib/python3.7/site-packages (from -r requirements/tests.txt (line 2)) (3.7.9)
Requirement already satisfied: pytest==5.2.4 in ./.venv/lib/python3.7/site-packages (from -r requirements/tests.txt (line 3)) (5.2.4)
Requirement already satisfied: pytest-cov==2.8.1 in ./.venv/lib/python3.7/site-packages (from -r requirements/tests.txt (line 4)) (2.8.1)
Requirement already satisfied: cov-core==1.15.0 in ./.venv/lib/python3.7/site-packages (from -r requirements/tests.txt (line 5)) (1.15.0)
Requirement already satisfied: sphinx==2.2.1 in ./.venv/lib/python3.7/site-packages (from -r requirements/tests.txt (line 6)) (2.2.1)
Requirement already satisfied: sphinx-rtd-theme==0.4.3 in ./.venv/lib/python3.7/site-packages (from -r requirements/tests.txt (line 7)) (0.4.3)
Requirement already satisfied: allure-behave==2.8.10 in ./.venv/lib/python3.7/site-packages (from -r requirements/tests.txt (line 9)) (2.8.10)
Requirement already satisfied: python-vlc==1.1.2 in ./.venv/lib/python3.7/site-packages (from -r requirements/tests.txt (line 11)) (1.1.2)
Requirement already satisfied: cucumber-tag-expressions>=1.1.2 in ./.venv/lib/python3.7/site-packages (from behave==1.2.7.dev1->-r requirements/tests.txt (line 8)) (3.0.1)
Requirement already satisfied: parse>=1.9.1 in ./.venv/lib/python3.7/site-packages (from behave==1.2.7.dev1->-r requirements/tests.txt (line 8)) (1.19.0)
Requirement already satisfied: parse_type>=0.4.2 in ./.venv/lib/python3.7/site-packages (from behave==1.2.7.dev1->-r requirements/tests.txt (line 8)) (0.5.2)
Requirement already satisfied: six>=1.12.0 in ./.venv/lib/python3.7/site-packages (from behave==1.2.7.dev1->-r requirements/tests.txt (line 8)) (1.16.0)
Requirement already satisfied: colorama in ./.venv/lib/python3.7/site-packages (from behave==1.2.7.dev1->-r requirements/tests.txt (line 8)) (0.4.4)
Requirement already satisfied: coverage<5.0,>=3.6 in ./.venv/lib/python3.7/site-packages (from coveralls==1.8.2->-r requirements/tests.txt (line 1)) (4.5.4)
Requirement already satisfied: docopt>=0.6.1 in ./.venv/lib/python3.7/site-packages (from coveralls==1.8.2->-r requirements/tests.txt (line 1)) (0.6.2)
Requirement already satisfied: requests>=1.0.0 in ./.venv/lib/python3.7/site-packages (from coveralls==1.8.2->-r requirements/tests.txt (line 1)) (2.25.1)
Requirement already satisfied: pyflakes<2.2.0,>=2.1.0 in ./.venv/lib/python3.7/site-packages (from flake8==3.7.9->-r requirements/tests.txt (line 2)) (2.1.1)
Requirement already satisfied: pycodestyle<2.6.0,>=2.5.0 in ./.venv/lib/python3.7/site-packages (from flake8==3.7.9->-r requirements/tests.txt (line 2)) (2.5.0)
Requirement already satisfied: entrypoints<0.4.0,>=0.3.0 in ./.venv/lib/python3.7/site-packages (from flake8==3.7.9->-r requirements/tests.txt (line 2)) (0.3)
Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in ./.venv/lib/python3.7/site-packages (from flake8==3.7.9->-r requirements/tests.txt (line 2)) (0.6.1)
Requirement already satisfied: atomicwrites>=1.0 in ./.venv/lib/python3.7/site-packages (from pytest==5.2.4->-r requirements/tests.txt (line 3)) (1.4.0)
Requirement already satisfied: pluggy<1.0,>=0.12 in ./.venv/lib/python3.7/site-packages (from pytest==5.2.4->-r requirements/tests.txt (line 3)) (0.13.1)
Requirement already satisfied: wcwidth in ./.venv/lib/python3.7/site-packages (from pytest==5.2.4->-r requirements/tests.txt (line 3)) (0.2.5)
Requirement already satisfied: more-itertools>=4.0.0 in ./.venv/lib/python3.7/site-packages (from pytest==5.2.4->-r requirements/tests.txt (line 3)) (8.8.0)
Requirement already satisfied: py>=1.5.0 in ./.venv/lib/python3.7/site-packages (from pytest==5.2.4->-r requirements/tests.txt (line 3)) (1.10.0)
Requirement already satisfied: attrs>=17.4.0 in ./.venv/lib/python3.7/site-packages (from pytest==5.2.4->-r requirements/tests.txt (line 3)) (21.2.0)
Requirement already satisfied: importlib-metadata>=0.12; python_version < "3.8" in ./.venv/lib/python3.7/site-packages (from pytest==5.2.4->-r requirements/tests.txt (line 3)) (4.5.0)
Requirement already satisfied: packaging in ./.venv/lib/python3.7/site-packages (from pytest==5.2.4->-r requirements/tests.txt (line 3)) (20.9)
Requirement already satisfied: Pygments>=2.0 in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (2.9.0)
Requirement already satisfied: sphinxcontrib-serializinghtml in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (1.1.5)
Requirement already satisfied: Jinja2>=2.3 in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (3.0.1)
Requirement already satisfied: babel!=2.0,>=1.3 in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (2.9.1)
Requirement already satisfied: imagesize in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (1.2.0)
Requirement already satisfied: sphinxcontrib-applehelp in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (1.0.2)
Requirement already satisfied: setuptools in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (57.0.0)
Requirement already satisfied: snowballstemmer>=1.1 in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (2.1.0)
Requirement already satisfied: sphinxcontrib-devhelp in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (1.0.2)
Requirement already satisfied: sphinxcontrib-qthelp in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (1.0.3)
Requirement already satisfied: docutils>=0.12 in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (0.17.1)
Requirement already satisfied: sphinxcontrib-jsmath in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (1.0.1)
Requirement already satisfied: sphinxcontrib-htmlhelp in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (2.0.0)
Requirement already satisfied: alabaster<0.8,>=0.7 in ./.venv/lib/python3.7/site-packages (from sphinx==2.2.1->-r requirements/tests.txt (line 6)) (0.7.12)
Requirement already satisfied: allure-python-commons==2.8.10 in ./.venv/lib/python3.7/site-packages (from allure-behave==2.8.10->-r requirements/tests.txt (line 9)) (2.8.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./.venv/lib/python3.7/site-packages (from requests>=1.0.0->coveralls==1.8.2->-r requirements/tests.txt (line 1)) (1.26.5)
Requirement already satisfied: certifi>=2017.4.17 in ./.venv/lib/python3.7/site-packages (from requests>=1.0.0->coveralls==1.8.2->-r requirements/tests.txt (line 1)) (2021.5.30)
Requirement already satisfied: chardet<5,>=3.0.2 in ./.venv/lib/python3.7/site-packages (from requests>=1.0.0->coveralls==1.8.2->-r requirements/tests.txt (line 1)) (4.0.0)
Requirement already satisfied: idna<3,>=2.5 in ./.venv/lib/python3.7/site-packages (from requests>=1.0.0->coveralls==1.8.2->-r requirements/tests.txt (line 1)) (2.10)
Requirement already satisfied: zipp>=0.5 in ./.venv/lib/python3.7/site-packages (from importlib-metadata>=0.12; python_version < "3.8"->pytest==5.2.4->-r requirements/tests.txt (line 3)) (3.4.1)
Requirement already satisfied: typing-extensions>=3.6.4; python_version < "3.8" in ./.venv/lib/python3.7/site-packages (from importlib-metadata>=0.12; python_version < "3.8"->pytest==5.2.4->-r requirements/tests.txt (line 3)) (3.10.0.0)
Requirement already satisfied: pyparsing>=2.0.2 in ./.venv/lib/python3.7/site-packages (from packaging->pytest==5.2.4->-r requirements/tests.txt (line 3)) (2.4.7)
Requirement already satisfied: MarkupSafe>=2.0 in ./.venv/lib/python3.7/site-packages (from Jinja2>=2.3->sphinx==2.2.1->-r requirements/tests.txt (line 6)) (2.0.1)
Requirement already satisfied: pytz>=2015.7 in ./.venv/lib/python3.7/site-packages (from babel!=2.0,>=1.3->sphinx==2.2.1->-r requirements/tests.txt (line 6)) (2021.1)
Building wheels for collected packages: behave
  Building wheel for behave (setup.py) ... done
  Created wheel for behave: filename=behave-1.2.7.dev1-py2.py3-none-any.whl size=152537 sha256=ee2b8813c479bfb45dd1af512eb9c1311b0f36d42988584d5a6917ad4e1e5575
  Stored in directory: /tmp/pip-ephem-wheel-cache-z4vf1h52/wheels/8b/89/12/fb03ed6b8ad8cca043932371c2105da0048a65d0b83b760c1a
Successfully built behave
WARNING: You are using pip version 20.0.2; however, version 21.1.2 is available.
You should consider upgrading via the '/home/pi/mycroft-core/.venv/bin/python -m pip install --upgrade pip' command.
Building with 3 cores.
Skipping mimic build.

I don’t see any error regarding a virtual environment, so, I think that that’s using a different venv that the one I’m working on is plausible.

Let’s go deeper: apt install libffi-dev , just in case. Failing that, see if there’s a package called something like python3-cffi-backend, rather than the cff-_backend that failed up there. That’s what the python3 interface is called on Debian.

Both libffi-dev and python3-cffi-backend were already installed.

My last idea is that some circular nonsense is going on. From your mycroft-core directory, source venv-activate.sh and pip3 install cffi just in case the wheel somehow isn’t before it tries to build.

After that, I must be missing something relatively obvious, like a third package name.

That was a problem, but not the problem.
Now unittest sees inflection, the only error it reports are ‘mycroft_bus_client’, “adapt”, and “speech_recognition” missing, which I assume should be installed by dev_setup.sh if it actually worked.

dev_setup.sh also sees that the latest version of Pip is installed (and reverts it to 20.0.2 for some reason), but still doesn’t see any _cffi_backend.

It doesn’t work yet, but progress is progress.

Yeah, all that stuff should be there. Something went “catastrophically” wrong in the course of dep hell, which is strange, cuz I’m not used to seeing dep hell =P

“Catastrophically” in that it would probably be easier to go nuclear, since you haven’t actually used Mycroft yet, than to go through the motions. After all, this time around, you’d have the various OS deps for sure from the get-go.

But, before that, with the .venv active, you could try manually installing all the python deps.

First, the base requirements, which should include the ones you just mentioned:

pip3 install -r requirements/requirements.txt

and if that still doesn’t work,

for file in ./requirements/extra*.txt; do
pip3 install -r $file
done

Not to throw a spanner in the works, Chance (I may be wrong) but It sorta seems to me like there’s a system library missing that wouldn’t ever be installed via pip install, but only via apt. The build of pynacl is choking on not being able to find some cffi libs, and I don’t think any pip install will remediate that. I can’t imagine which one it is, thus…

Were it me, padome, I might just try to install a system from scratch (understanding that you said you did not want to do that, but, as the Stones said, …what you want).

Since not even nuking did it, that and somehow figuring out what system package is missing seem to be the only answers.

It was a pain to setup a mail server (alongside several other servers) in there and I don’t wanna ditch it, I’d much rather just buy another Raspberry just for the job.

Well, you needn’t buy another rpi, just another SD card to flash Raspbian (or its successor, Raspberry Pi OS) to, or even Pycroft to, if only to prove that the software on the current card is in an inconsistent state. If that works, you know that something in your other SD card’s environ is borked, and it’s unclear how or why, but you’ll at least have a path forward, as unfun as a it may be.

This:

Shows you’re not using the virtual env.

I would delete the existing mycroft-core directory and start over fresh as chance mentioned. You could even install to a new path name instead if you want to keep the existing one, making sure to log all the steps you do in case you run into the same problem, so you can help diagnose what actually happened.

Something got missed the first time around for sure, fixing it isn’t going to be easy without knowing what that was.