树莓派搭建jupyter notebook、jupyterlab 报错解决办法

树莓派搭建jupyter notebook、jupyterlab 报错解决办法


error: command ‘arm-linux-gnueabihf-gcc’ failed with exit status 1

arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.8/c/_cffi_backend.o
      c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
         15 | #include 
            |          ^~~~~~~
      compilation terminated.
      error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8by4b4w4/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8by4b4w4/cffi/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-record-qb7roz9j/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-z06xgl2f/overlay --compile --install-headers /tmp/pip-build-env-z06xgl2f/overlay/include/python3.8/cffi Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/lib/python3/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-z06xgl2f/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://mirrors.aliyun.com/pypi/simple -- 'setuptools>=40.6.0' wheel 'cffi>=1.0' Check the logs for full command output.

报错原因是缺少必要依赖的库
执行apt-get install build-essential libssl-dev libffi-dev python3-dev

root@mypi:~# apt-get install build-essential libssl-dev libffi-dev python3-dev
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 9954 (unattended-upgr)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

报错
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 9954 (unattended-upgr)

解决方法:
删掉之前遗留下来的进程

root@mypi:~# sudo rm /var/cache/apt/archives/lock-frontend
root@mypi:~# sudo  rm /var/lib/dpkg/lock-frontend
root@mypi:~# sudo rm /var/cache/apt/archives/lock
root@mypi:~# sudo  rm /var/lib/dpkg/lock

然后重新运行安装即可解决问题。

你可能感兴趣的:(树莓派搭建jupyter notebook、jupyterlab 报错解决办法)