$ sudo apt search python-pip p python-pip - alternative Python package installer idA python-pip-whl - alternative Python package installer
$ sudo apt install python-pip Reading package lists... Done Building dependency tree Reading state information... Done Recommended packages: build-essential python-all-dev python-wheel The following NEW packages will be installed: python-pip 0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded. Need to get 0 B/144 kB of archives. After this operation, 635 kB of additional disk space will be used. Selecting previously unselected package python-pip. (Reading database ... 647024 files and directories currently installed.) Preparing to unpack .../python-pip_8.1.1-2ubuntu0.4_all.deb ... Unpacking python-pip (8.1.1-2ubuntu0.4) ... Processing triggers for man-db (2.7.5-1) ... Setting up python-pip (8.1.1-2ubuntu0.4) ...
$ sudo apt show python-pip Package: python-pip Version: 8.1.1-2ubuntu0.4 Priority: optional Section: universe/python Origin: Ubuntu Maintainer: Ubuntu Developers <email@example.com> Original-Maintainer: Debian Python Modules Team <firstname.lastname@example.org> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 635 kB Depends: ca-certificates, python-pip-whl (= 8.1.1-2ubuntu0.4), python:any (<< 2.8), python:any (>= 2.7.5-5~) Recommends: build-essential, python-all-dev (>= 2.6), python-setuptools, python-wheel Homepage: https://pip.pypa.io/en/stable/ Download-Size: 144 kB APT-Manual-Installed: yes APT-Sources: http://ubuntu-mirror.totbb.net/ubuntu xenial-updates/universe amd64 Packages Description: alternative Python package installer pip is a replacement for easy_install, and is intended to be an improved Python package installer. It integrates with virtualenv, doesn't do partial installs, can save package state for replaying, can install from non-egg sources, and can install from version control repositories. N: There is 1 additional record. Please use the '-a' switch to see it
$ sudo pip install Flask The directory '/home/nano/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/nano/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting Flask Downloading Flask-0.12.1-py2.py3-none-any.whl (82kB) 100% |████████████████████████████████| 92kB 691kB/s Requirement already satisfied: itsdangerous>=0.21 in /usr/lib/python2.7/dist-packages (from Flask) Collecting click>=2.0 (from Flask) Downloading click-6.7-py2.py3-none-any.whl (71kB) 100% |████████████████████████████████| 71kB 3.6MB/s Requirement already satisfied: Werkzeug>=0.7 in /usr/lib/python2.7/dist-packages (from Flask) Requirement already satisfied: Jinja2>=2.4 in /usr/lib/python2.7/dist-packages (from Flask) Requirement already satisfied: MarkupSafe in /usr/lib/python2.7/dist-packages (from Jinja2>=2.4->Flask) Installing collected packages: click, Flask Successfully installed Flask-0.12.1 click-6.7
$ nano hello.py #!/usr/bin/python from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello Nano!" if __name__ == "__main__": app.run('0.0.0.0')
$ chmod +x hello.py $ ./hello.py * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
$ curl http://localhost:5000 Hello Nano!