Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Positron Python Ext: Type parameter +_R_co without a default follows type parameter with a default when loading pytroch #5855

Open
ZhimingYe opened this issue Dec 24, 2024 · 0 comments

Comments

@ZhimingYe
Copy link

System details:

Positron and OS details:

Positron Version: 2025.01.0 (Universal) build 39
Code - OSS Version: 1.93.0
Commit: c7ef34f
Date: 2024-12-09T02:49:50.608Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin arm64 24.0.0

Interpreter details:

Conda_Environment.yml.txt

Describe the issue:

This is a very peculiar issue, it does not occur immediately or consistently every time. Most of the time, this issue does not appear during the initial loading (in other words, it behaves somewhat like a phantom, appearing sporadically). In my testing, repeatedly and quickly restarting the Python interpreter seems to increase the likelihood of triggering the issue. Restarting the remote host does not resolve the problem. However, this type of issue does not occur when using VS Code. I hope this information helps the Positron team in diagnosing the problem.

I cannot determine whether this is an issue with Positron itself or a specific package. However, the traceback ultimately points to Positron’s Python extension.

TypeError: Type parameter +_R_co without a default follows type parameter with a default.

Part of the traceback

File [~/miniconda3/envs/scvi-env/lib/python3.11/site-packages/lightning/pytorch/utilities/model_helpers.py:107](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#)
    103 _P = ParamSpec("_P")  # parameters of the decorated method
    104 _R_co = TypeVar("_R_co", covariant=True)  # return type of the decorated method
--> 107 class _restricted_classmethod_impl(Generic[_T, _P, _R_co]):
    108     """Drop-in replacement for @classmethod, but raises an exception when the decorated method is called on an instance
    109     instead of a class type."""
    111     def __init__(self, method: Callable[Concatenate[Type[_T], _P], _R_co]) -> None:

File [~/miniconda3/envs/scvi-env/lib/python3.11/typing.py:379](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#), in _tp_cache.<locals>.decorator.<locals>.inner(*args, **kwds)
    377 except TypeError:
    378     pass  # All real errors (not unhashable args) are raised below.
--> 379 return func(*args, **kwds)

File [~/miniconda3/envs/scvi-env/lib/python3.11/typing.py:1874](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#), in Generic.__class_getitem__(cls, params)
   1871             new_args.append(new_arg)
   1872     params = tuple(new_args)
-> 1874 return _GenericAlias(cls, params,
   1875                      _paramspec_tvars=True)

File [~/miniconda3/envs/scvi-env/lib/python3.11/typing.py:1383](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#), in _GenericAlias.__init__(self, origin, args, inst, name, _paramspec_tvars)
   1380     args = (args,)
   1381 self.__args__ = tuple(... if a is _TypingEllipsis else
   1382                       a for a in args)
-> 1383 self.__parameters__ = _collect_parameters(args)
   1384 self._paramspec_tvars = _paramspec_tvars
   1385 if not name:

File [~/.positron-server/bin/c7ef34fc7078ac7ecf13ff3328605dfba93f3eea/extensions/positron-python/python_files/positron/positron_ipykernel/_vendor/typing_extensions.py:3072](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#), in _collect_parameters(args)
   3070                 default_encountered = True
   3071             elif default_encountered:
-> 3072                 raise TypeError(f'Type parameter {t!r} without a default'
   3073                                 ' follows type parameter with a default')
   3075         parameters.append(t)
   3076 else:

Full_Traceback.txt

Steps to reproduce the issue:

Image

Expected or desired behavior:

In vscode:
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant