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

Can not import JSONRPC in python3.7 or 3.6 due to types #86

Closed
manortec opened this issue Dec 26, 2020 · 5 comments
Closed

Can not import JSONRPC in python3.7 or 3.6 due to types #86

manortec opened this issue Dec 26, 2020 · 5 comments
Assignees

Comments

@manortec
Copy link

Traceback (most recent call last):
File "/home/myuser/haoyidian/baike/venv/lib/python3.7/site-packages/flask_jsonrpc/types.py", line 35, in
from typing_extensions import Literal
ModuleNotFoundError: No module named 'typing_extensions'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 8, in
from h5 import app
File "/home/myuser/haoyidian/baike/h5/app.py", line 10, in
from flask_jsonrpc import JSONRPC
File "/home/myuser/haoyidian/baike/venv/lib/python3.7/site-packages/flask_jsonrpc/init.py", line 28, in
from .app import JSONRPC
File "/home/myuser/haoyidian/baike/venv/lib/python3.7/site-packages/flask_jsonrpc/app.py", line 32, in
from .globals import default_jsonrpc_site, default_jsonrpc_site_api
File "/home/myuser/haoyidian/baike/venv/lib/python3.7/site-packages/flask_jsonrpc/globals.py", line 30, in
from .site import JSONRPCSite
File "/home/myuser/haoyidian/baike/venv/lib/python3.7/site-packages/flask_jsonrpc/site.py", line 37, in
from .helpers import get, from_python_type
File "/home/myuser/haoyidian/baike/venv/lib/python3.7/site-packages/flask_jsonrpc/helpers.py", line 32, in
from .types import Types, Object
File "/home/myuser/haoyidian/baike/venv/lib/python3.7/site-packages/flask_jsonrpc/types.py", line 37, in
from typing import Literal # type: ignore # pylint: disable=C0412
ImportError: cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py)

@manortec
Copy link
Author

It could import JSONRPC porperly in python3.8,but not 3.7 or 3.6

@manortec manortec changed the title Can not run in python3.7 or 3.6 Can not import JSONRPC in python3.7 or 3.6 due to types Dec 27, 2020
@nycholas
Copy link
Member

Hi,

Try to used master version, in this PR[1], we added this dependencies.

[1] - #83

@nycholas nycholas self-assigned this Dec 29, 2020
@manortec
Copy link
Author

manortec commented Jan 2, 2021

@nycholas Thanks! Yes,it works when I used the master version. Before,I used the version on pipy,and that version was not up to date.

@manortec manortec closed this as completed Jan 2, 2021
@mrJeppard
Copy link

This solution worked for me with an additional pip install typing-inspect in python 3.7.3. Not sure if this is something wrong with the setup.py or a problem specific to a python version range including 3.7.3, but thought I'd leave a note in case it is helpful.

@nycholas
Copy link
Member

nycholas commented Apr 8, 2021

@mrJeppard yes, it have a problem with setup.py... the depence typing-inspect was added[1][2] after and I didn't update setup.py with them. Let be free to create a new pull request with this modification.

Thank you.

[1] - https://github.com/cenobites/flask-jsonrpc/blob/master/requirements.pip#L10
[2] - a63b126

nycholas added a commit that referenced this issue Jul 2, 2021
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

3 participants