Python 3
March 30, 2018 — 14:26

Author: silver  Category: dev  Comments: Off

Print modules:

python3 -c "import sys;print (sys.path)"
python3 -c "import sys;print (sys.modules)"
python3 -c "help('modules')"
python3 -c "help('modules package')"
pydoc3 modules


  • Location in Debian: /usr/lib/python{3}/dist-packages/pkgname/{}
  • Other distro’s use “site-packages”

pip3 install pkgname
pip3 uninstall pkgname
pip3 freeze
python3 -m pip install pkgname

import pip
sorted(["%s==%s" % (i.key, i.version) for i in pip.get_installed_distributions()])


$ pip3 install virtualenv
$ mkdir workdir && cd workdir
$ virtualenv project
$ source project/bin/activate
$ pip3 install requests

(and/or git clone + python3 install / etc)

$ deactivate
$ rm -rf project


  • make sure your does not have the same name as package
  • print syntax changed from python2 to 3: print ("foo")

We use Matomo free and open source web analytics
We also use Jetpack Stats which honores DNT