Garulf / Github-Notifications

View your github notifications
3 stars 0 forks source link

Problem with Python's Package - Error when calling "gn" #53

Open Xelbayria opened 7 months ago

Xelbayria commented 7 months ago

I've checked everything I can think of and couldn't find the problem. The Package has its package from Python to use. I appreciate if i can get some help with this. Please see the log below.

Error Log Please open new issue in: https://github.com/Garulf/github-notifications/issues 1. upload log file: flow-launcher\app-1.17.1\UserData\Logs\1.17.1\2024-02-06.txt 2. copy below exception message Flow Launcher version: 1.17.1 OS Version: 19045.3930 IntPtr Length: 8 x64: True Python Path: flow-launcher\app-1.17.1\UserData\Environments\Python\PythonEmbeddable-v3.11.4\pythonw.exe Node Path: Date: 02/06/2024 22:45:14 Exception: Github Notifications Exception: Websites: https://github.com/Garulf/github-notifications Author: Garulf Version: 4.0.3 Flow.Launcher.Core.ExternalPlugins.FlowPluginException: ModuleNotFoundError: No module named '_cffi_backend' thread '' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pyo3-0.20.2\src\err\mod.rs:788:5: Python API call failed note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Traceback (most recent call last): File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\run.py", line 9, in from plugin.main import GithubNotifications File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\plugin\main.py", line 4, in from github import Github File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\github\__init__.py", line 51, in from . import Auth File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\github\Auth.py", line 33, in import jwt File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\jwt\__init__.py", line 1, in from .api_jwk import PyJWK, PyJWKSet File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\jwt\api_jwk.py", line 7, in from .algorithms import get_default_algorithms, has_crypto, requires_cryptography File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\jwt\algorithms.py", line 12, in from .utils import ( File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\jwt\utils.py", line 7, in from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurve File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\cryptography\hazmat\primitives\asymmetric\ec.py", line 11, in from cryptography.hazmat._oid import ObjectIdentifier File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\cryptography\hazmat\_oid.py", line 7, in from cryptography.hazmat.bindings._rust import ( pyo3_runtime.PanicException: Python API call failed ---> System.IO.InvalidDataException: ModuleNotFoundError: No module named '_cffi_backend' thread '' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pyo3-0.20.2\src\err\mod.rs:788:5: Python API call failed note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Traceback (most recent call last): File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\run.py", line 9, in from plugin.main import GithubNotifications File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\plugin\main.py", line 4, in from github import Github File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\github\__init__.py", line 51, in from . import Auth File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\github\Auth.py", line 33, in import jwt File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\jwt\__init__.py", line 1, in from .api_jwk import PyJWK, PyJWKSet File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\jwt\api_jwk.py", line 7, in from .algorithms import get_default_algorithms, has_crypto, requires_cryptography File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\jwt\algorithms.py", line 12, in from .utils import ( File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\jwt\utils.py", line 7, in from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurve File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\cryptography\hazmat\primitives\asymmetric\ec.py", line 11, in from cryptography.hazmat._oid import ObjectIdentifier File "flow-launcher\app-1.17.1\UserData\Plugins\Github Notifications-4.0.3\lib\cryptography\hazmat\_oid.py", line 7, in from cryptography.hazmat.bindings._rust import ( pyo3_runtime.PanicException: Python API call failed at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 249 at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 249 at Flow.Launcher.Core.Plugin.JsonRPCPlugin.QueryAsync(Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 264 at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass23_0.<b__0>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 196 --- End of stack trace from previous location --- at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func`1 action) in C:\projects\flow-launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 40 at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 230 --- End of inner exception stack trace --- at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass23_1.b__1(ActionContext _) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 224 at Flow.Launcher.Plugin.Result.ExecuteAsync(ActionContext context) in /_/Flow.Launcher.Plugin/Result.cs:line 221 at Flow.Launcher.ViewModel.MainViewModel.OpenResultAsync(String index) in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 294 at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask) at System.Threading.Tasks.Task.<>c.b__128_0(Object state) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Garulf commented 7 months ago

Unfortunately the library I am using "pygithub" for this plugin added a compiled dependency.

Because of this the plugin must be run with the Python version it was packaged with in order to work.

Until I can fix this you may use python 3.8 and the issue should go away.

Xelbayria commented 7 months ago

That explains what's the problem. I got an idea of how to fix the issue temporarily.

red-daut commented 6 months ago

I have fixed this by installing the cffi package as follows pip install cffi I am using python 3.12.2

This plugin works nicely after installing that package.

No need to use python 3.8 as suggested earlier in this thread.

Xelbayria commented 6 months ago

hmm, i forgot about this issue. i'll give your solution a try.

red-daut commented 6 months ago

This issue seems to be a duplicate of #39