-
Notifications
You must be signed in to change notification settings - Fork 42
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
Exception 'TextArea' object has no attribute 'preferred_width' #12
Comments
For what it's worth: just tried to run using a direct install from master ( |
This doesn't seem to be matplotlib related, the following causes the same error (works well in ipython) from prompt_toolkit import print_formatted_text, HTML
print_formatted_text(HTML('<b>This is bold</b>')) |
Hi, I'm a bit surprised you were still experiencing this with I've been working on fixing the display of ansi output containing carriage returns (which includes The two code snippets you posted look currently give the following output with |
Yeah I mean I showed you the pip install output directly copy pasted so unless something with poetry is wonky it should've been 0.1.11. I just tried to reinstall it (I have no experience with poetry, just doing I tried uninstalling poetry, and deleting the git project and reinstalling everything twice but to no avail so unfortunately I can help debug because I can't install euporie anymore and pip is still at 0.1.9. |
Forgive me if I'm telling you what you already know. It appears you might still have pip install --upgrade euporie This should update If you want to run euporie from master, you'll need to run something like: git clone https://github.com/joouha/euporie.git
cd euporie
poetry install
poetry run euporie Running You can run |
thanks a ton for the help with debugging here! We're making progress: Now I'm not getting any errors, but also no outputs for the plotting
Thanks this is very helpful! However, unfortunately, like the issue I've linked, I can't run any poetry commands right now, even after wiping it from my system/fresh install. The linked issue mentiones potential to delete the cache folder fixing it, however, this cache isn't created on my machine (no ❯ poetry install
TypeError
expected string or bytes-like object
at ~/.poetry/lib/poetry/_vendor/py3.8/poetry/core/utils/helpers.py:27 in canonicalize_name
23│ _canonicalize_regex = re.compile(r"[-_]+")
24│
25│
26│ def canonicalize_name(name): # type: (str) -> str
→ 27│ return _canonicalize_regex.sub("-", name).lower()
28│
29│
30│ def module_name(name): # type: (str) -> str
31│ return canonicalize_name(name).replace(".", "_").replace("-", "_")
❯ pwd
/Users/yingzhu_/euporie |
If you install You can install it as an optional dependency of euporie with:
Have you tried upgrading poetry? You appear to be running |
I solved the poetry issue (was a package installed somehow with invalid metadata file). However, on the master branch's version of 0.1.12 the display issues still persist |
I'm a bit perplexed! This could be a bug with kitty image rendering. I know the way I have implemented kitty image rendering needs work. What version of kitty are you using? (Unfortunately I do not have access to a Mac). If you create a cell with an image output then scroll so the cell is partially off-screen, do you see the image rendered as text? Are you able to get text-mode image output in another terminal? |
Using kitty 0.19.3 both timg and the matplotlib kitty backend work well Again thanks a lot for helping debugging this. wrt to Mac: I know a lot of co's use https://www.macstadium.com/ for their CI to test things. |
Interesting. Feels like we're getting closer! The kitty graphics protocol allows you to do more complex things with images then sixel graphics, such as hide & show, duplicate, and move images. Currently I'm not making full use of it's capabilities - I'm just clearing all images from a notebook and re-drawing them every time the display is drawn. I'm already aware of some issues with with the way I implemented this (one is that images are cleared per notebook, which means that if you have multiple notebooks, only the images from one notebook will be displayed). I suspect the problem you are having may be related. Rewriting the euporie's kitty graphics code so images are shown, hidden, and moved without re-drawing them is on my to-do list. |
The "colinear!" text you are seeing is OS-level standard error output from the kernel ( The same thing happens with JupyterLab - output is printed to the terminal where the kernel was started rather than being displayed in the notebook: There is an old IPython issue about this I remember from years ago: ipython/ipython#1230 The issue mentions a nice IPython extension |
Yes I had realized that this actually occurs in other frontends as well (which is why I had deleted the comment). Thanks a lot this is super helpful though |
@joouha I think this isn't a png specific issue btw - also occurs for svg's - just no output created when printing them. |
The reason this occurs with SVGs is because euporie converts them to PNG format to render them. Could you try upgrading to |
Also just updated kitty to |
FYI @joouha - i finally had time to dig deeper here and now see where the opening of another NB with image works vs local fails. Appears to have something todo with the kernel's response. Here is the message {'header': {'msg_id': '7fb602e6-758acaed5578b6bb8bb27ea9_9', 'msg_type': 'status', 'username': 'yingzhu', 'session': '7fb602e6-758acaed5578b6bb8bb27ea9', 'date': datetime.datetime(2021, 6, 20, 4, 14, 13, 446180, tzinfo=tzutc()), 'version': '5.3'}, 'msg_id': '7fb602e6-758acaed5578b6bb8bb27ea9_9', 'msg_type': 'status', 'parent_header': {'msg_id': 'db07f97c-9ee867c0ccc2844ddf569eaa_1', 'msg_type': 'execute_request', 'username': 'yingzhu', 'session': 'db07f97c-9ee867c0ccc2844ddf569eaa', 'date': datetime.datetime(2021, 6, 20, 4, 14, 13, 413123, tzinfo=tzutc()), 'version': '5.3'}, 'metadata': {}, 'content': {'execution_state': 'busy'}, 'buffers': []}
message {'header': {'msg_id': '7fb602e6-758acaed5578b6bb8bb27ea9_10', 'msg_type': 'execute_input', 'username': 'yingzhu', 'session': '7fb602e6-758acaed5578b6bb8bb27ea9', 'date': datetime.datetime(2021, 6, 20, 4, 14, 13, 446630, tzinfo=tzutc()), 'version': '5.3'}, 'msg_id': '7fb602e6-758acaed5578b6bb8bb27ea9_10', 'msg_type': 'execute_input', 'parent_header': {'msg_id': 'db07f97c-9ee867c0ccc2844ddf569eaa_1', 'msg_type': 'execute_request', 'username': 'yingzhu', 'session': 'db07f97c-9ee867c0ccc2844ddf569eaa', 'date': datetime.datetime(2021, 6, 20, 4, 14, 13, 413123, tzinfo=tzutc()), 'version': '5.3'}, 'metadata': {}, 'content': {'code': "%matplotlib inline\nimport matplotlib.pyplot as plt\nplt.plot([1, 2, 3, 4])\nplt.ylabel('some numbers')\nplt.show()", 'execution_count': 2}, 'buffers': []}
message {'header': {'msg_id': '7fb602e6-758acaed5578b6bb8bb27ea9_12', 'msg_type': 'status', 'username': 'yingzhu', 'session': '7fb602e6-758acaed5578b6bb8bb27ea9', 'date': datetime.datetime(2021, 6, 20, 4, 14, 13, 491437, tzinfo=tzutc()), 'version': '5.3'}, 'msg_id': '7fb602e6-758acaed5578b6bb8bb27ea9_12', 'msg_type': 'status', 'parent_header': {'msg_id': 'db07f97c-9ee867c0ccc2844ddf569eaa_1', 'msg_type': 'execute_request', 'username': 'yingzhu', 'session': 'db07f97c-9ee867c0ccc2844ddf569eaa', 'date': datetime.datetime(2021, 6, 20, 4, 14, 13, 413123, tzinfo=tzutc()), 'version': '5.3'}, 'metadata': {}, 'content': {'execution_state': 'idle'}, 'buffers': []} You can see that elif msg_type == "stream":
elif msg_type in ("error", "display_data", "execute_result"): are never hit so it'll never render. I'm not too familiar w/ the jupyter message protocol but will debug further |
poetry made this extra difficult to debug as it had a lot of issues I never encountered with normal pip repos, ran into a lot of open issues on the repo, just my 2cents, you might want to consider to switch to pip (I appreciate the design decision of poetry and the problem it tries to solve, but in practice it didn't solve it for me while the conda/pip combo with pinned versions in requirements works good enough). |
Awesome - I'm so pleased you fixed this! What actually was the problem in the end? |
realized that for pngs the ipykernel would not send the correct data for
the mimetypes back - it would just choke and then switch to idle instead of
sending the display data. If, however, I overwrote the handling by using
`IPython.display.Image(<myobj>._repr_png_)` directly, it would work. Turned
out that I had a custom matplotlib backend in my `syspath` that was loaded
in my `ipython_config` I had put there months ago, which hijacked the
rendering. removing that resolved the issue :)
…On Mon, Jun 21, 2021 at 3:25 PM Josiah Outram Halstead < ***@***.***> wrote:
Awesome - I'm so pleased you fixed this!
What actually was the problem in the end?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#12 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOD5NN6P2XSRG5W7GGVAZIDTT6N2VANCNFSM446PAXZQ>
.
|
Trying to use the inline plotting, I'm using kitty.
Here's the code:
This will immediately exit to the terminal and print the following strace
Some setup info:
The text was updated successfully, but these errors were encountered: