Quartz module

Quartz module

brad.bylls
Collaborator Collaborator
831 Views
6 Replies
Message 1 of 7

Quartz module

brad.bylls
Collaborator
Collaborator

My add-in imports the 'keyboard' module that works well on my Win machine.

I have the keyboard library in my code library.

I am using it so when the user enters some data in a text box, it 'Tabs' to the next text box and also 'Esc' after a message 'error' box.

However, when loading up on a Mac OS it gives an error about not finding a "Quartz" module which it is looking for in keyboard.py.

All I can find on the internet is to use "pip install pyobjc"

I don't think all users will know how to do this.

Is there something I can put in my code to do this automatically?

Or where can I find the 'Quartz' library to put in my code library like I did with the keyboard library?

Or using something else instead of 'keyboard' that works on both Mac and Win?

Thank you.

Brad Bylls
0 Likes
832 Views
6 Replies
Replies (6)
Message 2 of 7

tykapl.breuil
Advocate
Advocate

What you can do is manually pip install pyojbc then in the installation logs you'll get the location of what was installed. Then simply put it in a file in your addin and adding the path to that file in sys.path (with sys.path.insert).

0 Likes
Message 3 of 7

brad.bylls
Collaborator
Collaborator

That does not work for me.

I get error messages:

ERROR: Could not find a version that satisfies the requirement quartz (from versions: 0.0.1.dev0)
ERROR: No matching distribution found for quartz

I tried: pip install quartz

I tried: pip install pyojbc

I tried: pip install pyobc-framework-quartz

They all come up with error messages

 

Brad Bylls
0 Likes
Message 4 of 7

tykapl.breuil
Advocate
Advocate

I have the same problem when trying to install quartz on my machine but that's a quartz problem not a fusion api one.

0 Likes
Message 5 of 7

brad.bylls
Collaborator
Collaborator

So I finally got the Quartz module loaded.

Now Quartz needs AppKit to be imported.

Here is what I get:

$ py -m pip install --user AppKit
Collecting AppKit
  Using cached AppKit-0.2.8.tar.gz (7.6 kB)
Collecting flask
  Using cached Flask-2.0.2-py3-none-any.whl (95 kB)
Collecting pygobject
  Using cached PyGObject-3.42.0.tar.gz (716 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting beautifulsoup4
  Using cached beautifulsoup4-4.10.0-py3-none-any.whl (97 kB)
Collecting Werkzeug>=2.0
  Using cached Werkzeug-2.0.2-py3-none-any.whl (288 kB)
Collecting click>=7.1.2
  Using cached click-8.0.3-py3-none-any.whl (97 kB)
Collecting itsdangerous>=2.0
  Using cached itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Collecting Jinja2>=3.0
  Using cached Jinja2-3.0.3-py3-none-any.whl (133 kB)
Collecting pycairo>=1.16.0
  Using cached pycairo-1.20.1-cp37-cp37m-win_amd64.whl (1.2 MB)
Collecting soupsieve>1.2
  Using cached soupsieve-2.3.1-py3-none-any.whl (37 kB)
Requirement already satisfied: colorama; platform_system == "Windows" in c:\users\bradb\appdata\roaming\python\python37\site-packages (from click>=7.1.2->flask->AppKit) (0.4.3)
Collecting importlib-metadata; python_version < "3.8"
  Using cached importlib_metadata-4.10.1-py3-none-any.whl (17 kB)
Collecting MarkupSafe>=2.0
  Using cached MarkupSafe-2.0.1-cp37-cp37m-win_amd64.whl (14 kB)
Collecting zipp>=0.5
  Using cached zipp-3.7.0-py3-none-any.whl (5.3 kB)
Collecting typing-extensions>=3.6.4; python_version < "3.8"
  Using cached typing_extensions-4.0.1-py3-none-any.whl (22 kB)
Using legacy setup.py install for AppKit, since package 'wheel' is not installed.
Building wheels for collected packages: pygobject
  Building wheel for pygobject (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe' 'C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\bradb\AppData\Local\Temp\tmprb1c1hj9'
       cwd: C:\Users\bradb\AppData\Local\Temp\pip-install-7w3rldvr\pygobject
  Complete output (44 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.7
  creating build\lib.win-amd64-3.7\pygtkcompat
  copying pygtkcompat\generictreemodel.py -> build\lib.win-amd64-3.7\pygtkcompat
  copying pygtkcompat\pygtkcompat.py -> build\lib.win-amd64-3.7\pygtkcompat
  copying pygtkcompat\__init__.py -> build\lib.win-amd64-3.7\pygtkcompat
  creating build\lib.win-amd64-3.7\gi
  copying gi\docstring.py -> build\lib.win-amd64-3.7\gi
  copying gi\importer.py -> build\lib.win-amd64-3.7\gi
  copying gi\module.py -> build\lib.win-amd64-3.7\gi
  copying gi\pygtkcompat.py -> build\lib.win-amd64-3.7\gi
  copying gi\types.py -> build\lib.win-amd64-3.7\gi
  copying gi\_constants.py -> build\lib.win-amd64-3.7\gi
  copying gi\_error.py -> build\lib.win-amd64-3.7\gi
  copying gi\_gtktemplate.py -> build\lib.win-amd64-3.7\gi
  copying gi\_option.py -> build\lib.win-amd64-3.7\gi
  copying gi\_ossighelper.py -> build\lib.win-amd64-3.7\gi
  copying gi\_propertyhelper.py -> build\lib.win-amd64-3.7\gi
  copying gi\_signalhelper.py -> build\lib.win-amd64-3.7\gi
  copying gi\__init__.py -> build\lib.win-amd64-3.7\gi
  creating build\lib.win-amd64-3.7\gi\repository
  copying gi\repository\__init__.py -> build\lib.win-amd64-3.7\gi\repository
  creating build\lib.win-amd64-3.7\gi\overrides
  copying gi\overrides\Gdk.py -> build\lib.win-amd64-3.7\gi\overrides
  copying gi\overrides\GdkPixbuf.py -> build\lib.win-amd64-3.7\gi\overrides
  copying gi\overrides\GIMarshallingTests.py -> build\lib.win-amd64-3.7\gi\overrides
  copying gi\overrides\Gio.py -> build\lib.win-amd64-3.7\gi\overrides
  copying gi\overrides\GLib.py -> build\lib.win-amd64-3.7\gi\overrides
  copying gi\overrides\GObject.py -> build\lib.win-amd64-3.7\gi\overrides
  copying gi\overrides\Gtk.py -> build\lib.win-amd64-3.7\gi\overrides
  copying gi\overrides\keysyms.py -> build\lib.win-amd64-3.7\gi\overrides
  copying gi\overrides\Pango.py -> build\lib.win-amd64-3.7\gi\overrides
  copying gi\overrides\__init__.py -> build\lib.win-amd64-3.7\gi\overrides
  running build_ext
  creating build\temp.win-amd64-3.7
  creating build\temp.win-amd64-3.7\Release
  creating build\temp.win-amd64-3.7\Release\gi
  "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPY_SSIZE_T_CLEAN -IC:\Users\bradb\AppData\Local\Temp\pip-install-7w3rldvr\pygobject -IC:\Users\bradb\AppData\Local\Temp\pip-install-7w3rldvr\pygobject\gi "-IC:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\Include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcgi\gimodule.c /Fobuild\temp.win-amd64-3.7\Release\gi\gimodule.obj -FImsvc_recommended_pragmas.h
  gimodule.c
  gi\gimodule.c: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  ----------------------------------------
  ERROR: Failed building wheel for pygobject
Failed to build pygobject
ERROR: Could not build wheels for pygobject which use PEP 517 and cannot be installed directly

Any help appreciated.

Thank you.

Brad Bylls
0 Likes
Message 6 of 7

tykapl.breuil
Advocate
Advocate

Maybe try adding this flag to your command ?

--no-use-pep517

If that doesn't work, as this isn't a Fusion API specific problem, I would advise creating a thread on some more general site (stack overflow maybe ?) where you might get some better help.

0 Likes
Message 7 of 7

brad.bylls
Collaborator
Collaborator

Thanks, but did not work.

I'll try stackflow.

Brad Bylls
0 Likes