Typing Library identified as a custom package on the server

When I try to use some type objects from the standard library typing library on the server side, I get this popup:

Why am I seeing this since its part of the standard library even in python3.7?

could you paste the import that you’re using on the server,
As well as the error message you’re getting in the console

I suspect it’s a mistaken import that’s causing the error
And the alert is misleading

e.g.

from typing import foo

Gives the same alert, but the console error says
ImportError: cannot import name 'foo' from 'typing' (/usr/local/lib/python3.7/typing.py)

Ok, I see the issue: I import this:

from typing import Iterable, Literal, Optional, Union

and got this error: ImportError: cannot import name 'Literal' from 'typing' (/usr/local/lib/python3.7/typing.py) since Literal apparently was only a thing since python3.8

I thought it was just the whole of the typing library that was problematic because of the popup, but it was just one specific import. That popup really shouldn’t be appearing.

Agreed (we’ll get that fixed)

2 Likes