-
Notifications
You must be signed in to change notification settings - Fork 171
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
Seems a bug for the layout for the Chinese Character #52
Comments
same issue |
You can assign this issue to me, I believe I am working on a solution. The problem is due to which version of Unicode is used by wcwidth, may be different from the version supported by your Terminal Emulator. The next version of wcwidth will support all versions of Unicode, and the version used by wcwidth (and tabulate) will be selected by an environment variable. And so the solution is to only select the correct version. I am also working on a CLI utility, |
I thought this was a unicode version issue, which I am working on a good solution for. But, there is no issue for me to reproduce here, at least on a Mac, using the version of I have tried |
@sidkang can you check if you have wcwidth at all installed ( |
@jquast @dricetar Hi, thanks for your kind reply. Sorry for not test the issue throughly. Just Checked the code in the terminal. Everything works perfectly. The Error only occurred in the Jupiter lab environment. So this could be a Jupiter side issue? |
@sidkang: maybe you have multiple python environments, from your Juperlab, are you able to successfully import subprocess, sys
subprocess.check_call([sys.executable, "-mpip", "install", "wcwidth"]) best wishes |
Just checked the wcwidth package. Seems it is working properly. |
By the way what happened the first time the issue appeared after installing wcwidth, is you probably needed to restart your Jupyter kernel, you always need to do that when you install/upgrade packages that have already been imported there is a kind of refresh button in the GUI for it, but anyway it happened naturally when you stepped away for the day :) glad your issue is resolved best wishes |
This issue seems to be fixed now: This was fixed in pull request #58 |
With Chinese characters in the DataFrame, it seems the tabulate package cannot identify the correct width.
The Output is :

0.8.7
True
|---|-----|-------------|------------|
| 0 | 001 | 汽车TESLA | 特殊 |
| 1 | 021 | 飞机737-MAX | 一长串字符 |
| 2 | 032 | TRAIN | 字符+1020 |
The text was updated successfully, but these errors were encountered: