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

Spyder cannot accept Chinese input #4120

Closed
willhunger opened this issue Feb 8, 2017 · 31 comments · Fixed by #21260
Closed

Spyder cannot accept Chinese input #4120

willhunger opened this issue Feb 8, 2017 · 31 comments · Fixed by #21260

Comments

@willhunger
Copy link

Description of your problem

What steps will reproduce the problem?

  1. When i edit with a django project
  2. I try to input Chinese character
  3. but i failed

What is the expected output? What do you see instead?
When i input a Chinese character,i got Chinese Pinyin on screen.
I use the SougouINPUT

Please provide any additional information below

Versions and main components

  • Spyder Version:Spyder 3.12
  • Python Version:Python 3.53
  • Operating system:ubuntu 16.10
  • Python 3.5.2+ 64bits, Qt 5.7.0, PyQt5 5.7 on Linux

Dependencies

Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:

@ccordoba12 ccordoba12 added this to the v3.2 milestone Feb 8, 2017
@ccordoba12
Copy link
Member

Could you write those characters here?

@willhunger
Copy link
Author

willhunger commented Feb 9, 2017

Of course i can write here @ccordoba12
哈哈哈哈

@jitseniesen
Copy link
Member

Ha ha.

I don't use Sougou but I use fcitx to input pinyin on Debian, which is almost the same as Ubuntu. My experience is that Chinese input does not work in the Anaconda version of Spyder, but it does work in the Debian version of Spyder. Pasting Chinese characters into Spyder always works. It may have something to do with how Qt is packaged.

@willhunger How did you install Spyder?

@ccordoba12 ccordoba12 modified the milestones: v3.2, v3.3 Feb 14, 2017
@willhunger
Copy link
Author

@jitseniesen
Yes,So do I.
I install Spyder by pip

@xyl576807077
Copy link

xyl576807077 commented Feb 17, 2017

I met the same problem when I wrote comment using chinese

@ccordoba12 ccordoba12 changed the title Spyder cannot accept Chinese inpuy Spyder cannot accept Chinese input Feb 17, 2017
@willhunger
Copy link
Author

@xyl576807077
请问现在你是否解决了?

@xyl576807077
Copy link

@willhunger
没有解决,已经暂时使用jupyter notebook了

@willhunger
Copy link
Author

@xyl576807077 我也切换到了vscode

@wjt-one
Copy link

wjt-one commented Oct 20, 2017

现在修复好了么?

@wjt-one
Copy link

wjt-one commented Dec 26, 2017

@ccordoba12 @jitseniesen could fix this problem now? it makes work so troublesome.

@ccordoba12
Copy link
Member

Sorry, none of us are Chinese speakers/users. So we'll wait until a Chinese hacker send us a pull request to fix it.

@wjt-one
Copy link

wjt-one commented Dec 29, 2017

@ccordoba12 I also install Japanese input methods(fcitx-anthy),and find the same issue occur.so I think it's a problem about " the Anaconda version of Spyder in Ubuntu 16.04LTS" , which maybe can't accept any other language than english.thanks.

@isaaclu0897
Copy link

isaaclu0897 commented Apr 8, 2018

我也有相同的情況!!

我的環境是:
Ubuntu 16.04 LTS
anaconda 的spyder

之前使用 ibus框架下的的 chewing(新酷音)輸入法可以正常在 spyder下輸入中文。
最近想學拼音輸入法,因此轉戰 fcitx框架下的 sougou拼音輸入法,便不能正常輸入中文了。
(註: 其他的應用程式(jupyter、 chrome等等)都可以正常輸入)

不知道這東西有沒有解?

@isaaclu0897
Copy link

更新

剛剛測試了一下,在 fcitx框架所有的輸入法都無法鍵入中文。
但是 ibus的新酷音以及拼音都可以正常輸入。

看來這是程式與 fcitx框架不相容的問題。

@willhunger
Copy link
Author

@t104306033
问题是fcitx 与所有的Qt5构建的应用都不能兼容

@willhunger
Copy link
Author

willhunger commented Apr 16, 2018

@wjt-one
Fctix cannot input any characters except Latino characters to Qt5 Application.
So you can change your input method framework to hack this problem

@cedarice
Copy link

cedarice commented Jun 5, 2018

可以这么解决
首先需要自己编译fcitx-qt5:
安装依赖:sudo apt install cmake extra-cmake-modules fcitx-libs-dev libxkbcommon-dev
克隆或下载最新版的fcitx-qt5: https://github.com/fcitx/fcitx-qt5/releases
然后编译:cmake ./
make
最后在platforminputcontext文件夹中的libfcitxplatforminputcontextplugin.so复制到anaconda3/plugins/platforminputcontexts/文件夹中,重新启动spyder即可输入中文。
我的系统是Ubuntu 18.04 LTS,Spyder是通过Anaconda安装的。

@bramson
Copy link

bramson commented Jul 23, 2018

I think this is the right place for my problem. I'm running Spyder from Anaconda running from Bash on Ubuntu on Windows...all the latest versions.
After installing a bunch of Japanese fonts on the Ubuntu distro, the Japanese characters all appear in a highly stylized font "MikaChan", the first one installed.
This isn't very readable, but I don't see any way to change the font used for rendering Japanese text in the iPython console.

@shilkazx
Copy link

The fix is not work for me. I am on Archlinux x64, anaconda 5.1 py36 and spyder 3.2.6 package from anaconda. I've already try a soft link or a hard copy of libfcitxplatforminputcontextplugin.so(Archlinux fcitx-qt5 package) to anaconda/plugins/platforminputcontexts, but seems nothing happend.

@xiaohongniua
Copy link

I got the same problem, and every time I input one char,it shows two on the screen

@Firestar-Reimu
Copy link

Feedback in 2021: Spyder can input Chinese on Windows 11 but not on my Manjaro Linux. I use Spyder 5.1.5 and fcitx5.

@ccordoba12
Copy link
Member

ccordoba12 commented Oct 27, 2021

Hey @1900011604, thanks for the reminder. It seems this problem is solved now, but only if you're using conda-forge.

If you're already using it, you need to run

conda install -c conda-forge fcitx-qt5

If not, you need to run

conda create -n spyder-env -c conda-forge python=3.9 spyder fcitx-qt5
conda activate spyder-env
spyder

That's because conda-forge and Anaconda are incompatible, so you can't mix packages from both.

Please do that and let us know if it works for you.

@Firestar-Reimu
Copy link

@ccordoba12 It works, thanks!

@Firestar-Reimu
Copy link

It seems that spyder can input Chinese on Linux (I use fcitx5). I use Archlinux repository and installed spyder by pacman:

https://archlinux.org/packages/community/any/spyder/

https://github.com/archlinux/svntogit-community/blob/packages/spyder/trunk/PKGBUILD

This do not need the python package fcitx-qt5.

@ccordoba12
Copy link
Member

This do not need the python package fcitx-qt5.

This is only necessary for Anaconda users.

@JGSphaela
Copy link

Just stumbled across this issue as I wasn't able input Japanese with fcitx in spyder, so I want to write a quick update. The solution below provided by @ccordoba12 still totally works now and solve the issue:

If not, you need to run

conda create -n spyder-env -c conda-forge python=3.9 spyder fcitx-qt5
conda activate spyder-env
spyder

I noticed tho python=3.9 is not necessary as I successfully install it on Python 3.11. And in my test, a dedicate conda env for spyder, as suggest in @ccordoba12 's code, is really recommended as it can avoid compatible issues.

@ccordoba12
Copy link
Member

To everyone subscribed to this issue: it'll be fixed in Spyder 6 (to be released before the end of the year) for our Conda packages and also our new Linux installer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.