-
-
Notifications
You must be signed in to change notification settings - Fork 671
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
ImportError: cannot import name 'get_terminal_size' from 'click.termui' #377
Comments
I think that'll be fixed in #375 |
Same here, also running into this exception with CORRECTION: tl;dr: Check your |
bump version
Click had a breaking change in a minor version bump `8.0.4` -> `8.1.0` (see fastapi/typer#377) and black `22.1.0` has an incompatibility with click `8.1.0` (bumping to `22.3.0` should fix this)
Same issue also with the minimal example from the docs on a clean Conda environment with Python 3.9.11. Actually, the error is raised when merely running ➜ python
Python 3.9.11 (main, Mar 28 2022, 05:06:49)
[Clang 12.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import typer
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/drorata/anaconda3/envs/foo/lib/python3.9/site-packages/typer/__init__.py", line 12, in <module>
from click.termui import get_terminal_size as get_terminal_size
ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/Users/drorata/anaconda3/envs/foo/lib/python3.9/site-packages/click/termui.py) |
Exactly the same error for me with Python 3.7.13 : Python 3.7.13 (default, Mar 18 2022, 17:46:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import typer
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/www/ai/env/lib/python3.7/site-packages/typer/__init__.py", line 12, in <module>
from click.termui import get_terminal_size as get_terminal_size
ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/var/www/ai/env/lib/python3.7/site-packages/click/termui.py) |
After downgrading Typer to 0.3.2 the problem is gone. |
After downgrading Click to 0.4.1 the problem is gone. |
This temporary solution : explosion/spaCy#10564 (comment) works for me → |
That correct !! I just fix the same your way. I downgrade |
This is a workaround for this Typer issue: fastapi/typer#377
This is a workaround for this Typer issue: fastapi/typer#377
I am seeing the same on a dependabot PR proposing to update the click version to 8.1
|
Thanks, I uninstall click and install again with 8.0.4 and works |
Click had a breaking change in a minor version bump `8.0.4` -> `8.1.0` (see fastapi/typer#377) and black `22.1.0` has an incompatibility with click `8.1.0` (bumping to `22.3.0` should fix this)
1. fastapi/typer#377 makes it necessary to update the version of typer to use a pinned version of click (that has the `get_terminal_size` function) 2. updated the other couple of main deoendencies a little 3. also need to specify requests 4. generated a new requirements.txt using `pip freeze` After which `python search.py --help` works.
`click` >= 8.1 leads to this error during merge: ``` ImportError: cannot import name 'get_terminal_size' from 'click.termui' ``` See also fastapi/typer#377
this also updates the typer dependency to fix fastapi/typer#377
Apologies to add to noise. Reinforcing @drorata's comment that upgrading Typer to 0.4.1 resolved the issue and managed not to break any other dependencies in my gcp + pandas data pipeline. |
Due to this error [1]: Traceback (most recent call last): File "/mcu-firmware/examples/sys_sysmon/sysmon-client.py", line 9, in <module> import typer File "/mcu-firmware/venv/lib/python3.10/site-packages/typer/__init__.py", line 12, in <module> from click.termui import get_terminal_size as get_terminal_size ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/mcu-firmware/venv/lib/python3.10/site-packages/click/termui.py) [1] fastapi/typer#377
Due to this error [1]: Traceback (most recent call last): File "/mcu-firmware/examples/sys_sysmon/sysmon-client.py", line 9, in <module> import typer File "/mcu-firmware/venv/lib/python3.10/site-packages/typer/__init__.py", line 12, in <module> from click.termui import get_terminal_size as get_terminal_size ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/mcu-firmware/venv/lib/python3.10/site-packages/click/termui.py) [1] fastapi/typer#377
Due to this error [1]: Traceback (most recent call last): File "/mcu-firmware/examples/sys_sysmon/sysmon-client.py", line 9, in <module> import typer File "/mcu-firmware/venv/lib/python3.10/site-packages/typer/__init__.py", line 12, in <module> from click.termui import get_terminal_size as get_terminal_size ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/mcu-firmware/venv/lib/python3.10/site-packages/click/termui.py) [1] fastapi/typer#377
Due to this error [1]: Traceback (most recent call last): File "/mcu-firmware/examples/sys_sysmon/sysmon-client.py", line 9, in <module> import typer File "/mcu-firmware/venv/lib/python3.10/site-packages/typer/__init__.py", line 12, in <module> from click.termui import get_terminal_size as get_terminal_size ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/mcu-firmware/venv/lib/python3.10/site-packages/click/termui.py) [1] fastapi/typer#377
Due to this error [1]: Traceback (most recent call last): File "/mcu-firmware/examples/sys_sysmon/sysmon-client.py", line 9, in <module> import typer File "/mcu-firmware/venv/lib/python3.10/site-packages/typer/__init__.py", line 12, in <module> from click.termui import get_terminal_size as get_terminal_size ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/mcu-firmware/venv/lib/python3.10/site-packages/click/termui.py) [1] fastapi/typer#377
Due to this error [1]: Traceback (most recent call last): File "/mcu-firmware/examples/sys_sysmon/sysmon-client.py", line 9, in <module> import typer File "/mcu-firmware/venv/lib/python3.10/site-packages/typer/__init__.py", line 12, in <module> from click.termui import get_terminal_size as get_terminal_size ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/mcu-firmware/venv/lib/python3.10/site-packages/click/termui.py) [1] fastapi/typer#377
Due to this error [1]: Traceback (most recent call last): File "/mcu-firmware/examples/sys_sysmon/sysmon-client.py", line 9, in <module> import typer File "/mcu-firmware/venv/lib/python3.10/site-packages/typer/__init__.py", line 12, in <module> from click.termui import get_terminal_size as get_terminal_size ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/mcu-firmware/venv/lib/python3.10/site-packages/click/termui.py) [1] fastapi/typer#377 Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues. |
* Update data.json * Update scenario.py * Update test.py * Update tests.json * Update requirements.txt * Update skill.py * Update requirements.txt * Update test_no_annotations.json * Update combined_classifier.json * Codestyle using BLACK * Update utils.py * Update test.py * Update test.py * Update server.py * Update test.py * Update test.py * Update test.py * Update test.py * Update test.py * Update test.py * Update test.py * Update test.py * Update test.py * Update server.py * Update test.py * Update test.py * Update test.py * codestyle * Update utils.py * Renamed topic_classification, deleted unnesessary string * Speeded up the combined classifier * Update Dockerfile * New version of DeepPavlov * Clean new combined - with fixed bug in checkout * Update README.md * Further speeded up multitask BERT model * Update Dockerfile * I have done my best to speed up the multitask inference. * Update utils.py * DeepPavlov version after several fixes. Also, new distil model ( not final, in training!) * hh * Tests fixed * Update test.py * codestyle * Returned cuda cache * Update Dockerfile * Test change for memory profiling * It should work much faster now * It should work much faster now * It should work much faster now * Test editings to tackle test_dialog fail * Update server.py * Update combined_classifier.json * codestyle * Update Dockerfile * Update combined_classifier.json * Current test-passing version * Changed factoid criteria & postprocess for cobot topics and intents * Changed factoid criteria & postprocess for cobot topics and intents * Minor test fix - updated "random skills" list * codestyle * codestyle * Update factoid.py * Update connector.py * Utilize unified prob threshold in factoid skill. Before these changes, 2 different thresholds for factoid were set. One threshold 0.96 to turn the skill on, another 0.9 in the same skill. Given that the current model classifies question "where is montreal" as factoid with 0.55 probability, I have set the threshold 0.5 for both of these cases. And made the one threshold to use in both places to streamline the code * Dilya's suggestion https://github.com/deeppavlov/dream/pull/207/files#r1016588010 * Dilya's suggestion https://github.com/deeppavlov/dream/pull/207/files#r1016569392 * Dilya's suggestions * Dilya's suggestion * Dilya's suggestion * Dilya's comment * Update Dockerfile * Update Dockerfile * Update combined_classifier.json * Update README.md * current changes * Codestyle * Added dependency to fix bug fastapi/typer#377 * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update combined_classifier.json * Update test.py * Update server.py * Update combined_classifier.json * Update server.py * Update test.py * Passes skill tests now * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update server.py * Fix bug * Update Dockerfile * Update dev.yml * Update combined_classifier.json * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Update requirements.txt * Added factoid threshold * Update connector.py * Update server.py * Codestyle * Codestyle * Suggested changes * current version * Fixed sentence len * Added setuptools dependency while numpy 1.18.0 not to fail on build * Added setuptools dependency while numpy 1.18.0 not to fail on build * Still facing bug numpy/numpy#22623 - restrict numpy version * h * Try to fix bug in test_dialog in utils/analyze_downloads.py while importing DeepPavlov - no module named ruamel. We might need to install it in dockerfile * Update utils.py * Update utils.py * Threshold fixes as siggested by Dilya * Cosmetic change * Update combined_classifier.json * fixed tests * codestyle * Update utils.py * Suggested phrase fix * Update dev.yml * Remove empty requirements changes * requirements fix * Update connector.py * Revert prev commit * Names as in original * added cache * Update utils.py * Update utils.py * Update animals.py * Update art.py * Update books.py * Update food.py * Update gaming.py * Update gaming.py * Update music.py * Update art.py * Update travel.py * Update science.py * Update books.py * Update food.py * Update gaming.py * Update gossip.py * Update sport.py * Update sport.py * Update music.py * Update movies.py * codestyle * codestyle * Classname fix in tests * suggested changes * Update test.py * Update test.py * Update Dockerfile * suggested changes * Update Dockerfile * Update combined_classifier.json * Update Dockerfile * Now we can infer for all postannotations * Update Dockerfile * Codestyle. Tests of combined (in old config) are passed 2x faster thanks to the improved caching * Decreased inference time by another 25% without quality loss * fixed tests * codestyle * New log format * Update combined_classifier.json * Changed singletask sentence length from 64 to 32 to speed model up by 15% and to make the compatibility with current DEV version * Update server.py * Remove MIDAS from pipeline * Remove MIDAS from pipeline * remove MIDAS from WAIT_HOSTS * MIDAS from pipeline * Убираю Мидас из WAIT_HOSTS и пайплайна * Убираю Мидас из WAIT_HOSTS и пайплайна * Not referring to midas annotations anymore and not waiting for midas * All combined classification timeouts set to 2 sec * Update dp_formatters.py * Update dp_formatters.py * Midas classification is a dict * Get intents by function from common * Update README.md * codestyle Co-authored-by: dimakarp1996 <dimakarp1996@github.com>
Bot closed this but it appears to be unresolved. |
Here's the definition of the missing function at the time of removal:
I believe it should be trivial to fix this particular issue (and it wouldn't even break compatibility with click-8.0). |
…Waitaminute According to release notes, this was fixed back in v0.4.1 over a year ago. |
First Check
Commit to Help
Example Code
Description
typer
(0.4.0) andclick
(8.1.0)import typer
get_terminal_size
having been removed in click 8.1.0 (remove deprecated code pallets/click#2130)Operating System
Linux
Operating System Details
Ubunutu 20.04
Typer Version
0.4.0
Python Version
Python 3.8.10
Additional Context
No response
The text was updated successfully, but these errors were encountered: