Python 3.5.2 使用apt安装Cherrypy

Python 3.5.2 Installation of Cherrypy with apt

我用 CherryPy 为 Python 开发了一个小型网络应用程序。我想在 ubuntu 16.04 的生产服务器上 运行 这个。我的系统管理员告诉我,我不会使用 pip 或 github 存储库,因为......使用除了 apt 之外的任何东西都有问题......他说。

有没有办法用 apt 为 python3 获取最近的 cherrypy?

在 Ubuntu 上安装 cherrypy 绝对没问题。 这是我在我的服务器上所做的:

首次安装pip

sudo apt-get install python-pip

sudo apt install python-pip

或 Python3(尝试 apt 或 apt-get)

sudo apt install python3-pip 

安装pip后,安装cherrypy

pip install cherrypy

确保你已经安装了python并且基于python版本安装了pip。安装pip后,一切都会好起来的。这适用于我的 Ubuntu 服务器。

Ubuntu 16.04 上的解决方案 python3 (Python 3.5.2):

为python3

安装虚拟环境

sudo apt-get 安装 python3-venv

为您的环境创建一个文件夹

mkdir 环境

创建环境

python3 -m venv 环境

进入文件夹

cd environment/bin

激活环境

来源激活

在环境中安装 pip

apt 安装python3-pip

安装 cherrypy >= 18.1.0

pip3 安装 cherrypy

运行 程序

python3 ./my_python_script.py