boppreh / keyboard

Hook and simulate global keyboard events on Windows and Linux.
MIT License
3.77k stars 433 forks source link

Installation broken on linux/windows #143

Closed russlevy closed 6 years ago

russlevy commented 6 years ago

Starting with version 0.13, running pip install keyboard doesn't seem to work.

Collecting keyboard
  Downloading keyboard-0.13.0-py2.py3-none-any.whl (54kB)
    100% |████████████████████████████████| 61kB 4.5MB/s
Collecting pyobjc (from keyboard)
  Downloading pyobjc-4.1-py2-none-any.whl
Collecting pyobjc-framework-CFNetwork==4.1 (from pyobjc->keyboard)
  Downloading pyobjc-framework-CFNetwork-4.1.tar.gz (69kB)
    100% |████████████████████████████████| 71kB 4.6MB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-SKani6/pyobjc-framework-CFNetwork/setup.py", line 26, in <module>
        extra_link_args=['-framework', 'CoreServices'],
      File "pyobjc_setup.py", line 386, in Extension
        os_level = get_os_level()
      File "pyobjc_setup.py", line 200, in get_os_level
        pl = plistlib.readPlist('/System/Library/CoreServices/SystemVersion.plist')
      File "/usr/lib/python2.7/plistlib.py", line 75, in readPlist
        pathOrFile = open(pathOrFile)
    IOError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-SKani6/pyobjc-framework-CFNetwork/
alxchk commented 6 years ago

pip install --upgrade --user git+https://github.com/boppreh/keyboard -- works

From pip - same story

boppreh commented 6 years ago

I think this is due to the new pyobjc declaration format. Instead if reading the platform name in runtime, we are using a setuptools format to declare a dependency is MacOS only.

I'll revert back to the old format and publish a fix as soon as I can.

boppreh commented 6 years ago

setup.py fixed in version 0.,13.1. Please use pip install --no-cache keyboard if your pip cached the version with incorrect dependency.

Thank you for the timely bug report, it would have taken me a while to realize the problem since I always work locally.

sushrut29 commented 4 years ago

I am getting this error while installing "pyttsx3" which is saying something like pyobjc . Please help me
FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

danish2694 commented 4 years ago

Were you able to resolve it @sushrut29? As I am also getting the same error.

khushbu-mulani commented 4 years ago

@sushrut29 @danish2694 you can install "pyttsx3" using

pip install git+https://github.com/nateshmbhat/pyttsx3

sushrut29 commented 4 years ago

I have solved the problem. Uninstalled Python 3.7 , installed Python 3.6 and then pip install pyttsx3 worked superbly ! @danish2694

Pmad9 commented 4 years ago

@sushrut29 @danish2694 you can install "pyttsx3" using

pip install git+https://github.com/nateshmbhat/pyttsx3

PS C:\Users\puneetm\Desktop\PB\MIS\vs files> pip install pyttsx3 Collecting pyttsx3 Using cached pyttsx3-2.84-py3-none-any.whl (39 kB) Collecting pyobjc>=2.4 Using cached pyobjc-6.1-py3-none-any.whl (2.9 kB) Collecting comtypes; "win32" in sys_platform Using cached comtypes-1.1.7.zip (180 kB) Collecting pyobjc-framework-SearchKit==6.1 Downloading pyobjc_framework_SearchKit-6.1-py2.py3-none-any.whl (3.3 kB) Collecting pyobjc-framework-CoreAudio==6.1 Downloading pyobjc-framework-CoreAudio-6.1.tar.gz (82 kB) |████████████████████████████████| 82 kB 33 kB/s ERROR: Command errored out with exit status 1: command: 'C:\Users\puneetm\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\puneetm\AppData\Local\Temp\pip-install-r4abkijd\pyobjc-framework-CoreAudio\setup.py'"'"'; file='"'"'C:\Users\puneetm\AppData\Local\Temp\pip-install-r4abkijd\pyobjc-framework-CoreAudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\puneetm\AppData\Local\Temp\pip-install-r4abkijd\pyobjc-framework-CoreAudio\pip-egg-info' cwd: C:\Users\puneetm\AppData\Local\Temp\pip-install-r4abkijd\pyobjc-framework-CoreAudio\ Complete output (15 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\puneetm\AppData\Local\Temp\pip-install-r4abkijd\pyobjc-framework-CoreAudio\setup.py", line 30, in extra_link_args=["-framework", "CoreAudio"], File "C:\Users\puneetm\AppData\Local\Temp\pip-install-r4abkijd\pyobjc-framework-CoreAudio\pyobjc_setup.py", line 408, in Extension os_level = get_os_level() File "C:\Users\puneetm\AppData\Local\Temp\pip-install-r4abkijd\pyobjc-framework-CoreAudio\pyobjc_setup.py", line 218, in get_os_level pl = plistlib.readPlist("/System/Library/CoreServices/SystemVersion.plist") File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64qbz5n2kfra8p0\lib\plistlib.py", line 99, in readPlist with _maybe_open(pathOrFile, 'rb') as fp: File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64qbz5n2kfra8p0\lib\contextlib.py", line 112, in enter return next(self.gen) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\plistlib.py", line 82, in _maybe_open with open(pathOrFile, mode) as fp: FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'

getting this error

surajmahendra2552 commented 4 years ago

C:\Users\Suraj Mahendra\Desktop\mahe>pip install pyttsx3 Collecting pyttsx3 Using cached pyttsx3-2.84-py3-none-any.whl (39 kB) Collecting comtypes; "win32" in sys_platform Using cached comtypes-1.1.7.zip (180 kB) Collecting pyobjc>=2.4 Using cached pyobjc-6.1-py3-none-any.whl (2.9 kB) Collecting pyobjc-framework-CoreAudioKit==6.1 Downloading pyobjc-framework-CoreAudioKit-6.1.tar.gz (18 kB) ERROR: Command errored out with exit status 1: command: 'c:\users\suraj mahendra\appdata\local\programs\python\python36-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Suraj Mahendra\AppData\Local\Temp\pip-install-v5txapef\pyobjc-framework-CoreAudioKit\setup.py'"'"'; file='"'"'C:\Users\Suraj Mahendra\AppData\Local\Temp\pip-install-v5txapef\pyobjc-framework-CoreAudioKit\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Suraj Mahendra\AppData\Local\Temp\pip-install-v5txapef\pyobjc-framework-CoreAudioKit\pip-egg-info' cwd: C:\Users\Suraj Mahendra\AppData\Local\Temp\pip-install-v5txapef\pyobjc-framework-CoreAudioKit\ Complete output (15 lines): Traceback (most recent call last): File "", line 1, in File "C:\Users\Suraj Mahendra\AppData\Local\Temp\pip-install-v5txapef\pyobjc-framework-CoreAudioKit\setup.py", line 33, in for fn in os.listdir("Modules") File "C:\Users\Suraj Mahendra\AppData\Local\Temp\pip-install-v5txapef\pyobjc-framework-CoreAudioKit\pyobjc_setup.py", line 408, in Extension os_level = get_os_level() File "C:\Users\Suraj Mahendra\AppData\Local\Temp\pip-install-v5txapef\pyobjc-framework-CoreAudioKit\pyobjc_setup.py", line 218, in get_os_level pl = plistlib.readPlist("/System/Library/CoreServices/SystemVersion.plist") File "c:\users\suraj mahendra\appdata\local\programs\python\python36-32\lib\plistlib.py", line 162, in readPlist with _maybe_open(pathOrFile, 'rb') as fp: File "c:\users\suraj mahendra\appdata\local\programs\python\python36-32\lib\contextlib.py", line 82, in enter return next(self.gen) File "c:\users\suraj mahendra\appdata\local\programs\python\python36-32\lib\plistlib.py", line 120, in _maybe_open with open(pathOrFile, mode) as fp: FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

boppreh commented 4 years ago

People, this is a closed issue in the keyboard library and is entirely unrelated to the issue you are having. You'll get better answers if you post your question on StackOverflow or somewhere related to pyttsx3.

danish2694 commented 4 years ago

thanks, @khushbu-mulani & @sushrut29, I solved the issue by installing a lower version and it is working fine as of now.