How do you install Python Xlib with pip?

sudo pip install svn+https://svn.code.sf.net/p/python-xlib/code/trunk/

Worked for me.


pip3 install python3-xlib

and

pip3 install python-xlib

When we run this command from the terminal, we can easily install it:


Collecting python3-xlib
Downloading https://files.pythonhosted.org/packages/ef/c6/2c5999de3bb1533521f1101e8fe56fd9c266732f4d48011c7c69b29d12ae/python3-xlib-0.15.tar.gz (132kB)
     |████████████████████████████████| 133kB 1.3MB/s 
Installing collected packages: python3-xlib
  Running setup.py install for python3-xlib ... done
Successfully installed python3-xlib-0.15

GeorgeGentlys-Mac-mini:~ georgegently$ pip3 install python-xlib

Collecting python-xlib
Downloading https://files.pythonhosted.org/packages/f7/91/9f794491d1a8b810a9d4bb8fc9766a98354cb62bd6990685032b00f87001/python_xlib-0.25-py2.py3-none-any.whl (165kB)
     |████████████████████████████████| 174kB 1.3MB/s 
Collecting six>=1.10.0 (from python-xlib)
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, python-xlib
Successfully installed python-xlib-0.25 six-1.12.0```

Tags:

Python

Pip

Xlib