如果打包时出现错误:
OSError: Python library not found: Python8, libpython3.8m.dylib, Python, libpython3.8.dylib, .Python
This would mean your Python installation doesn't come with proper library files.
This usually happens by missing development package, or unsuitable build parameters of Python installation.* On Debian/Ubuntu, you would need to install Python development packages
* apt-get install python3-dev
* apt-get install python-dev
* If you're building Python by yourself, please rebuild your Python with `--enable-shared` (or, `--enable-framework` on Darwin)
出现上述错误后,需要重新启安装 python,将 libpython3.8m.dylib 复制到 /usr/lib 目录:
cp -R libpython3.8m.dylib /usr/lib
源码安装Python:
1、下载 python包:Python-3.8.1.tgz
2、解压python包:tar zxvf Python-3.8.1.tgz
3、进入解压的python目录:cd Python-3.8.1
4、源码安装python:sudo ./configure --enable-optimizations --enable-shared --prefix =/usr/local
5、安装
sudo make
sudo make install
6、将python lib 复制到 /usr/lib 重新打包
ModuleNotFoundError: No module named ‘_ctypes’解决办法
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus
sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev
sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev
sudo apt-get install libssl-dev openssl
sudo apt-get install libffi-dev
之后重新编译