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

error on python 3.8 #813

Closed
sergiynesterenko90 opened this issue Apr 28, 2023 · 2 comments
Closed

error on python 3.8 #813

sergiynesterenko90 opened this issue Apr 28, 2023 · 2 comments

Comments

@sergiynesterenko90
Copy link

This morning I just encountered this error:

nbqa-black...............................................................Failed
- hook id: nbqa-black
- exit code: 1

Traceback (most recent call last):
  File "/home/sergiy/.cache/pre-commit/repo8bh6v87k/py_env-python3.8/bin/nbqa", line 5, in <module>
    from nbqa.__main__ import main
  File "/home/sergiy/.cache/pre-commit/repo8bh6v87k/py_env-python3.8/lib/python3.8/site-packages/nbqa/__main__.py", line 20, in <module>
    from nbqa import replace_source, save_code_source, save_markdown_source
  File "/home/sergiy/.cache/pre-commit/repo8bh6v87k/py_env-python3.8/lib/python3.8/site-packages/nbqa/replace_source.py", line 22, in <module>
    from nbqa.save_code_source import CODE_SEPARATOR
  File "/home/sergiy/.cache/pre-commit/repo8bh6v87k/py_env-python3.8/lib/python3.8/site-packages/nbqa/save_code_source.py", line 14, in <module>
    from IPython.core.inputtransformer2 import TransformerManager
  File "/home/sergiy/.cache/pre-commit/repo8bh6v87k/py_env-python3.8/lib/python3.8/site-packages/IPython/__init__.py", line 30, in <module>
    raise ImportError(
ImportError: 
IPython 8.13+ supports Python 3.9 and above, following NEP 29.
IPython 8.0-8.12 supports Python 3.8 and above, following NEP 29.
When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
Python 3.3 and 3.4 were supported up to IPython 6.x.
Python 3.5 was supported with IPython 7.0 to 7.9.
Python 3.6 was supported with IPython up to 7.16.
Python 3.7 was still supported with the 7.x branch.

See IPython `README.rst` file for more information:

    https://github.com/ipython/ipython/blob/main/README.rst

Running rev 1.6.4 of https://github.com/nbQA-dev/nbQA

I didn't make any changes to my environment, nor precommit version. Is there some way to fix the ipython requirement to an older version like 8.12 that still works with python 3.8?

@MarcoGorelli
Copy link
Collaborator

hey - yup, you can specify additional_dependencies and pin ipython to the version you like

@sergiynesterenko90
Copy link
Author

Thanks @MarcoGorelli - that worked! Here's a snippet in case others find themselves looking for this:

-   repo: https://github.com/nbQA-dev/nbQA
    rev: 1.6.4
    hooks:
    - id: nbqa-black
      additional_dependencies: [ipython==8.12.0, black==22.3.0]

patrick-kidger added a commit to patrick-kidger/equinox that referenced this issue Apr 28, 2023
patrick-kidger added a commit to patrick-kidger/equinox that referenced this issue Apr 28, 2023
patrick-kidger added a commit to patrick-kidger/equinox that referenced this issue Apr 28, 2023
patrick-kidger added a commit to patrick-kidger/equinox that referenced this issue Apr 28, 2023
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

2 participants