Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Certain python modules broken by 'sudo pip install xlib'

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
mrmarcdee
Posts: 6
Joined: 2017-01-30 22:19

Certain python modules broken by 'sudo pip install xlib'

#1 Post by mrmarcdee »

I have a previously working python script that imports pyautogui.

I recently tried to do:

Code: Select all

pip install xlib
and it threw a bunch of errors, along with a permission denied. Not thinking or reading much, my instinct after seeing "permission denied" is to repeat the last code with 'sudo' in front of it.

Code: Select all

sudo pip install xlib
And it installed, along with 'six'.

Then next time I started my python script, it is unable to import pyautogui

Code: Select all

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pyautogui/__init__.py", line 115, in <module>
from . import _pyautogui_x11 as platformModule
File "/usr/local/lib/python2.7/dist-packages/pyautogui/_pyautogui_x11.py", line 7, in <module>
from Xlib.display import Display
File "/usr/local/lib/python2.7/dist-packages/Xlib/display.py", line 26, in <module>
from six import create_unbound_method
ImportError: cannot import name create_unbound_method

pip freeze shows:

Code: Select all

Pillow==2.6.1
PyAutoGUI==0.9.36
PyMsgBox==1.0.6
PyScreeze==0.1.14
PyTweening==1.0.3
SOAPpy==0.12.22
argparse==1.2.1
cffi==0.8.6
chardet==2.3.0
clipboard==0.0.4
colorama==0.3.2
cryptography==0.6.1
decorator==3.4.0
defusedxml==0.4.1
html5lib==0.999
ndg-httpsclient==0.3.2
numpy==1.8.2
ply==3.4
pyOpenSSL==0.14
pyasn1==0.1.7
pycparser==2.10
pyperclip==1.6.0
pytesseract==0.1.7
python-apt==0.9.3.12
python-dateutil==2.6.1
python-debian==0.1.27
python-debianbts==1.11
python3-xlib==0.15
readchar==0.7
reportbug==6.6.3
requests==2.4.3
scipy==0.14.0
six==1.8.0
urllib3==1.9.1
wheel==0.24.0
wsgiref==0.1.2
wstools==0.4.3
xlib==0.21

I need to get pyautogui back to working. Any ideas what to do?

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: Certain python modules broken by 'sudo pip install xlib'

#2 Post by dilberts_left_nut »

sudo unfuck python ? :wink:

Probably read the Debian python docs, learn what you broke by forcibly stuffing external things into the mix, then repair it.
AdrianTM wrote:There's no hacker in my grandma...

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Certain python modules broken by 'sudo pip install xlib'

#3 Post by Segfault »

Yup, running pip as root is a proven way to bork the system.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Certain python modules broken by 'sudo pip install xlib'

#4 Post by stevepusser »

Was there a problem with installing python-xlib and/or python3-xlib with apt instead?
MX Linux packager and developer

mrmarcdee
Posts: 6
Joined: 2017-01-30 22:19

Re: Certain python modules broken by 'sudo pip install xlib'

#5 Post by mrmarcdee »

dilberts_left_nut wrote:sudo unfuck python ? :wink:
I never knew about this command, my life will be so much easier now :D
Segfault wrote:Yup, running pip as root is a proven way to bork the system.
Heh... well now I know. I will charge myself with an AUI, Administering Under the Influence.
stevepusser wrote:Was there a problem with installing python-xlib and/or python3-xlib with apt instead?
Didn't even try it, I had been recently installing a handful of other python modules via pip that were not in apt repos. Honestly I can't even remember now why I was trying to install xlib.



So I think I fixed it by uninstalling via pip all the modules in question that I could, then re-installing via apt all the modules that I could, then when trying to reinstall pyautogui from pip I had to change the ownership of /usr/local/lib/python2.7/dist-packages in order to let pip install it. So still not too sure what happened, but seems ok. Now whenever I import pyautogui I get this message

Code: Select all

Xlib.protocol.request.QueryExtension

Post Reply