Closed nihal111 closed 5 years ago
On Fri, May 25 2018, Nihal Singh wrote:
I ran into problems while installing screenkey.
sudo ./setup.py install
gave errors for both pycairo and PyGTK.
This is not unsurprising. Language package managers such as pip will fail flatly on their face for anything but the simplest pure-python dependency.
pycairo
pycairo did not install straight from the install script.
Solution
I had to manually install pycairo, only worked after I did-
sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev
and thenpip install pycairo
to run.
The README instructions for ubuntu/debian involve installing pygtk and pycairo via:
apt-get install python-gtk2
This should work correctly and install python-cairo as a dependency. This will also result in way less installed dependencies, as there's no need to have developer tools installed.
Is there a reason why this didn't work before attempting to install pygtk from source?
apt-get install python-gtk2
Oh, yes I had done that. Also had tried apt-get install python-gtk2-dev
Neither stopped me from getting this error. I'm unsure why.
********************************************************************
* Building PyGTK using distutils is only supported on windows.
* To build PyGTK in a supported way, read the INSTALL file.
*********************************************************************
* Building PyGTK using distutils is only supported on windows. *
* To build PyGTK in a supported way, read the INSTALL file. *
.
.
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-cJ2V7E/pygtk
Thanks @nihal111 this helped me out; here was my process:
sudo apt-get install python-gtk2
remove PyGTK
from install_requires
, line 33 of setup.py
. Post edit looks as such:
scripts=['screenkey'],
packages=['Screenkey'],
setup_requires=['setuptools', 'python-distutils-extra'],
install_requires=['pycairo'],
data_files=[('share/applications', ['data/screenkey.desktop']),
('share/doc/screenkey', ['README.rst', 'NEWS.rst'])],
I ran into problems while installing screenkey.
sudo ./setup.py install
gave errors for both pycairo and PyGTK.pycairo
pycairo did not install straight from the install script.
Solution
I had to manually install pycairo, only worked after I did-
sudo apt-get install libcairo2-dev libjpeg-dev libgif-dev
and thenpip install pycairo
to run. It threw aPackage cairo was not found in the pkg-config search path.
Comment on pycairo issue SO RefPyGTK
Installing pygtk was a real headache, even messed up my pip and setuptools. I tried installing using
sudo pip install pygtk
, only to get this errorReference which explains the same problem
Solution
I found this gist that installs PyGTK. (simple ./configure && make; stuff I believe). Running the install script still didn't allow me to proceed since PyGTK wasn't installed as a pip package. I had to modify the setup.py file and remove 'PyGTK' from the
install_requires
list.After doing all this, I was finally able to get it to work. Hope this helps someone.