martin-ueding / thinkpad-scripts

Screen rotation, docking and other scripts for ThinkPad® X220 and X230 Tablet
Other
133 stars 23 forks source link

Problems installing on Ubuntu 19.04 #148

Closed manderso7 closed 4 years ago

manderso7 commented 4 years ago

I've cloned the repo and run setup.py install, but I'm not sure what to do afterwards for the software to work when changing to tablet mode and having the screen rotate. Nothing was created in ~/.config/ regarding thinkpad-* Any help will be useful. Here's the output of the installation

sudo python setup.py install
This is running on:
2.7.15+ (default, Oct  7 2019, 17:39:04) 
[GCC 7.4.0]
()
running install
running bdist_egg
running egg_info
creating thinkpad_scripts.egg-info
writing thinkpad_scripts.egg-info/PKG-INFO
writing top-level names to thinkpad_scripts.egg-info/top_level.txt
writing dependency_links to thinkpad_scripts.egg-info/dependency_links.txt
writing entry points to thinkpad_scripts.egg-info/entry_points.txt
writing manifest file 'thinkpad_scripts.egg-info/SOURCES.txt'
reading manifest file 'thinkpad_scripts.egg-info/SOURCES.txt'
writing manifest file 'thinkpad_scripts.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/tps
copying tps/unity.py -> build/lib.linux-x86_64-2.7/tps
copying tps/sound.py -> build/lib.linux-x86_64-2.7/tps
copying tps/hooks.py -> build/lib.linux-x86_64-2.7/tps
copying tps/rotate.py -> build/lib.linux-x86_64-2.7/tps
copying tps/__init__.py -> build/lib.linux-x86_64-2.7/tps
copying tps/main_touchscreen.py -> build/lib.linux-x86_64-2.7/tps
copying tps/vkeyboard.py -> build/lib.linux-x86_64-2.7/tps
copying tps/main_trackpoint.py -> build/lib.linux-x86_64-2.7/tps
copying tps/main_touchpad.py -> build/lib.linux-x86_64-2.7/tps
copying tps/screen.py -> build/lib.linux-x86_64-2.7/tps
copying tps/input.py -> build/lib.linux-x86_64-2.7/tps
copying tps/config.py -> build/lib.linux-x86_64-2.7/tps
copying tps/network.py -> build/lib.linux-x86_64-2.7/tps
copying tps/dock.py -> build/lib.linux-x86_64-2.7/tps
creating build/lib.linux-x86_64-2.7/tps/testsuite
copying tps/testsuite/test_network.py -> build/lib.linux-x86_64-2.7/tps/testsuite
copying tps/testsuite/test_hooks.py -> build/lib.linux-x86_64-2.7/tps/testsuite
copying tps/testsuite/__init__.py -> build/lib.linux-x86_64-2.7/tps/testsuite
copying tps/testsuite/test_screen.py -> build/lib.linux-x86_64-2.7/tps/testsuite
copying tps/testsuite/test_config.py -> build/lib.linux-x86_64-2.7/tps/testsuite
copying tps/testsuite/test_dock.py -> build/lib.linux-x86_64-2.7/tps/testsuite
copying tps/testsuite/test_input.py -> build/lib.linux-x86_64-2.7/tps/testsuite
copying tps/default.ini -> build/lib.linux-x86_64-2.7/tps
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/default.ini -> build/bdist.linux-x86_64/egg/tps
creating build/bdist.linux-x86_64/egg/tps/testsuite
copying build/lib.linux-x86_64-2.7/tps/testsuite/test_network.py -> build/bdist.linux-x86_64/egg/tps/testsuite
copying build/lib.linux-x86_64-2.7/tps/testsuite/test_hooks.py -> build/bdist.linux-x86_64/egg/tps/testsuite
copying build/lib.linux-x86_64-2.7/tps/testsuite/__init__.py -> build/bdist.linux-x86_64/egg/tps/testsuite
copying build/lib.linux-x86_64-2.7/tps/testsuite/test_screen.py -> build/bdist.linux-x86_64/egg/tps/testsuite
copying build/lib.linux-x86_64-2.7/tps/testsuite/test_config.py -> build/bdist.linux-x86_64/egg/tps/testsuite
copying build/lib.linux-x86_64-2.7/tps/testsuite/test_dock.py -> build/bdist.linux-x86_64/egg/tps/testsuite
copying build/lib.linux-x86_64-2.7/tps/testsuite/test_input.py -> build/bdist.linux-x86_64/egg/tps/testsuite
copying build/lib.linux-x86_64-2.7/tps/unity.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/sound.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/hooks.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/rotate.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/__init__.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/main_touchscreen.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/vkeyboard.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/main_trackpoint.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/main_touchpad.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/screen.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/input.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/config.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/network.py -> build/bdist.linux-x86_64/egg/tps
copying build/lib.linux-x86_64-2.7/tps/dock.py -> build/bdist.linux-x86_64/egg/tps
byte-compiling build/bdist.linux-x86_64/egg/tps/testsuite/test_network.py to test_network.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/testsuite/test_hooks.py to test_hooks.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/testsuite/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/testsuite/test_screen.py to test_screen.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/testsuite/test_config.py to test_config.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/testsuite/test_dock.py to test_dock.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/testsuite/test_input.py to test_input.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/unity.py to unity.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/sound.py to sound.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/hooks.py to hooks.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/rotate.py to rotate.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/main_touchscreen.py to main_touchscreen.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/vkeyboard.py to vkeyboard.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/main_trackpoint.py to main_trackpoint.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/main_touchpad.py to main_touchpad.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/screen.py to screen.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/input.py to input.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/config.py to config.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/network.py to network.pyc
byte-compiling build/bdist.linux-x86_64/egg/tps/dock.py to dock.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying thinkpad_scripts.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying thinkpad_scripts.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying thinkpad_scripts.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying thinkpad_scripts.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying thinkpad_scripts.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/thinkpad_scripts-4.12.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing thinkpad_scripts-4.12.0-py2.7.egg
Copying thinkpad_scripts-4.12.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding thinkpad-scripts 4.12.0 to easy-install.pth file
Installing thinkpad-touch script to /usr/local/bin
Installing thinkpad-config script to /usr/local/bin
Installing thinkpad-dock script to /usr/local/bin
Installing thinkpad-mutemic script to /usr/local/bin
Installing thinkpad-rotate-hook script to /usr/local/bin
Installing thinkpad-trackpoint script to /usr/local/bin
Installing thinkpad-touchpad script to /usr/local/bin
Installing thinkpad-dock-hook script to /usr/local/bin
Installing thinkpad-rotate script to /usr/local/bin
Installing thinkpad-scripts-config-migration script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/thinkpad_scripts-4.12.0-py2.7.egg
Processing dependencies for thinkpad-scripts==4.12.0
Finished processing dependencies for thinkpad-scripts==4.12.0

in addition, when running thinkpad-rotate manually, I get:

$ thinkpad-rotate
Traceback (most recent call last):
  File "/usr/local/bin/thinkpad-rotate", line 11, in <module>
    load_entry_point('thinkpad-scripts==4.12.0', 'console_scripts', 'thinkpad-rotate')()
  File "build/bdist.linux-x86_64/egg/tps/rotate.py", line 49, in main
  File "build/bdist.linux-x86_64/egg/tps/screen.py", line 253, in get_internal
  File "build/bdist.linux-x86_64/egg/tps/__init__.py", line 138, in wrapper
AttributeError: 'module' object has no attribute 'quote'
martin-ueding commented 4 years ago

I assume you mean that you install it on Ubuntu 19.04? Could you also state which device you use?

The offending line in the code is the following:

shell_command = ' '.join(map(shlex.quote,command))

From your last error message I see that the module object shlex does not appear to have the quote command. This command is present in all versions of Python 3. But you ran python setup.py and not python3 setup.py, so you have installed it with Python 2. You will need to install it again according to the installation instructions.

The configuration files in your home directory must be manually created.

manderso7 commented 4 years ago

Thanks, I needed to install w/ python3. Appreciate the assistance.