error while loading shared libraries: libpython3.5m.so.1.0

前言

如没特殊声明, 所有命令均以root执行

  • 环境简介
  • 问题描述
  • 解决步骤总览

环境简介

NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

root@cicd1:~/Python-3.5.7# which python3
/usr/local/bin/python3
root@cicd1:~/Python-3.5.7# which uwsgi
/usr/local/bin/uwsgi

问题描述

命令行使用uwsgi启动服务的时候, 直接报错:

root@cicd1:~/Python-3.7.3# /usr/local/bin/uwsgi
/usr/local/bin/uwsgi: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory

解决步骤

wget https://www.python.org/ftp/python/3.5.7/Python-3.5.7.tgz
tar zxvf Python-3.5.7.tgz
cd Python-3.5.7/
ls
./configure --enable-shared --enable-optimizations
#-j后面的参数是你机器的核数
make -j 4 altinstall
#加载公共库
ldconfig

你可能感兴趣的:(python)