Closed francescobianca closed 2 years ago
from openapi_parser import parse
TypeError: 'type' object is not subscriptable
Jupyter 6.4.5 Windows 11
Hi @francescobianca @MichielBbal, please note that current package requires Python 3.9 as you can see here, some changes are backward incompatible, please try with newer version, if it doesn't work, feel free to tag me again
My python version is 3.9.13, am still getting the ImportError, Am I missing something? @manchenkoff
@Anurag-Pola, I've just checked on your version, seems fine
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from openapi_parser import parse
>>> help(parse)
Help on function parse in module openapi_parser.parser:
parse(uri: str) -> openapi_parser.specification.Specification
Parse specification document by URL or filepath
Args:
uri (str): Path or URL to OpenAPI file
>>>
Please, check your version again or attach more details (like the output I pasted above)
Hey @manchenkoff , Thank You for the quick response and sorry for the delay in mine.
I tried the same but got the following error!
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from openapi_parser import parse
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'parse' from 'openapi_parser' (unknown location)
@Anurag-Pola it's so weird, unfortunately I don't have any useful thing to solve it and it seems that problem is not in the package. This error usually occurs when there is no object with given name, but it's definitely there.
Just out of curiosity, have you tried to install the package in virtualenv or pipenv?
I tried it out in pipenv and normal environment
@Anurag-Pola sad to hear that 😞 can you try to install 0.0.9 package version because later versions were updated to Python 3.9? If problem persists, I suggest reinstalling of python
First:
Now:
Python Version: 3.8 System: Ubuntu 20.04.3 LTS