Cherrypy in Ubuntu with apt install

75 views
Skip to first unread message

Marius Widmann

unread,
Feb 22, 2019, 1:18:03 PM2/22/19
to cherrypy-users
Hey there,

I have a litte web app developed with up to date cherrypy. My sysadmin tells me that he does not want any pip or github installations on our production server running ubuntu 16.04. He says something wrong with anything but apt install...

Is there a way to install cherrypy for ubuntu 16.04 via apt ?

Thanks a lot

Andrew Maizels

unread,
Feb 22, 2019, 1:23:05 PM2/22/19
to cherryp...@googlegroups.com
Sure.

Should be as simple as apt install python-cherrypy.

--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-user...@googlegroups.com.
To post to this group, send email to cherryp...@googlegroups.com.
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.


--
Ahh... We are all heroes; you and Boo and I.
Hamsters and rangers everywhere, rejoice!
Read Peopleware! http://www.amazon.com/Peopleware-Productive-Projects-Teams-Second/dp/0932633439

Sviatoslav Sydorenko

unread,
Feb 22, 2019, 5:12:08 PM2/22/19
to cherryp...@googlegroups.com
As long as you have that packaged correctly. We only officially support python distribution packages but you should be able to build your own deb package if you want.

Installing things from PyPI is not bad but you need to follow the rules. For example, by installing random things into system-managed site packages (aka with sudo) may damage your OS as it breaks consistently with things managed by apt. It is well-known that you can break things this way in dev-based distros. OS packagers normally test that various python-based things they wrap into deb packages work well together.

OTOH, using virtualenv is just fine. It isolates your env with deps for your app and reduces any damage you may cause by installing stuff.

Here's a great write-up on why you should use it: https://hynek.me/articles/virtualenv-lives/


--Sviatoslav.

Sent from my phone, please pardon any typos.

пт, 22 лют. 2019, 19:23 користувач Andrew Maizels <andrew....@gmail.com> пише:

Marius Widmann

unread,
Feb 24, 2019, 3:52:42 AM2/24/19
to cherrypy-users
Is the package from PyPi for Python3 ?

Marius Widmann

unread,
Feb 24, 2019, 3:52:42 AM2/24/19
to cherrypy-users
apt install python-cherrypy works only for python 2...

Marius Widmann

unread,
Feb 24, 2019, 3:52:42 AM2/24/19
to cherrypy-users
Can anyone point me out the exact steps to produce a package of cherrypy?

Sviatoslav Sydorenko

unread,
Feb 24, 2019, 3:55:48 AM2/24/19
to cherryp...@googlegroups.com
deb packaging traditions assume that the name should be different:

apt install python3-cherrypy 

(if it exists)



--Sviatoslav.

Sent from my phone, please pardon any typos.

нд, 24 лют. 2019, 09:52 користувач Marius Widmann <marius....@gmail.com> пише:

Sviatoslav Sydorenko

unread,
Feb 24, 2019, 3:57:31 AM2/24/19
to cherryp...@googlegroups.com
On PyPI, versions >=18 are Python 3 only.
Older versions <18 support both Python 2&3


--Sviatoslav.

Sent from my phone, please pardon any typos.
нд, 24 лют. 2019, 09:52 користувач Marius Widmann <marius....@gmail.com> пише:
Is the package from PyPi for Python3 ?

Sviatoslav Sydorenko

unread,
Feb 24, 2019, 3:58:45 AM2/24/19
to cherryp...@googlegroups.com
You mean deb package? It should be in Ubuntu docs packaging guides probably 


--Sviatoslav.

Sent from my phone, please pardon any typos.
нд, 24 лют. 2019, 09:52 користувач Marius Widmann <marius....@gmail.com> пише:
Can anyone point me out the exact steps to produce a package of cherrypy?

--

Marius Widmann

unread,
Feb 24, 2019, 8:30:20 AM2/24/19
to cherrypy-users
Unfortunately there is no up-to-date cherrpy package for Ubuntu...

Sviatoslav Sydorenko

unread,
Feb 24, 2019, 10:08:46 AM2/24/19
to cherryp...@googlegroups.com
Yeah, that is expected. Their release cycle is way longer than ours + somebody would have to maintain such deb package and keep it up-to-date.

So anyway you have to either wrap it yourself or use virtualenv which I recommend. For deb package you'd need to also make sure you have all proper dependencies packaged/available.

If you go for virtualenv, I recommend you having a constraints file which you can enforce using `pip install -c constraints.txt`. Make sure to add dist hashes to that file. You can generate that using pip-tools.
Oh and to have a reproducible deployment use smth like Ansible.

Another way to isolate your app env is to use docker, you may want to consider using it.



--Sviatoslav.

Sent from my phone, please pardon any typos.

нд, 24 лют. 2019, 14:30 користувач Marius Widmann <marius....@gmail.com> пише:

Marius Widmann

unread,
Feb 25, 2019, 12:44:57 PM2/25/19
to cherrypy-users
Thank you. I used a virtualenv

Marius Widmann

unread,
Feb 28, 2019, 4:51:41 AM2/28/19
to cherrypy-users
The solution on Ubuntu 16.04 with python3 (Python 3.5.2):

#Install virtualenvironment for python3
sudo apt-get install python3-venv

#Create a folder for your environment
mkdir environment

#Create the environment
python3 -m venv environment

#Change into folder
cd environment/bin

#Activate environment
source activate

#Install pip within the env
apt install python3-pip

#Install cherrypy >= 18.1.0
pip3 install cherrypy

#Run program
python3 ./my_python_script.py
Reply all
Reply to author
Forward
0 new messages