Error “[Core ] option --mode not recognized” importing Kivy on PyCharm

…衆ロ難τιáo~ 提交于 2020-01-05 04:13:07

问题


Importing kivy on PyCharm the following error shows up:

    [INFO   ] [Logger      ] Record log in 
    C:\Users\bill5\.kivy\logs\kivy_19-08-12_47.txt
    [ERROR  ] [Core        ] option --mode not recognized

While everything works fine using the same interpreter outside Pycharm.

The interpreter I am using in PyCharm is "C:\Users\MyName\PycharmProjects\Convert_py_for_android\venv\Scripts\python.exe". If I open python.exe on the same location and I import kivy everything works fine.


回答1:


I have Windows 10, Python 3.7.2 64 bits, and PyCharm 2018.3.7 Community Edition

This video shows what you need to do: https://www.youtube.com/watch?v=DHks4jfyLLk

Audio is in portuguese, however pycharm on it is in english, so you can follow the steps by watching it in full screen mode. The path he follows is:

File -> Settings -> Project:ProjectName -> Project Interpreter -> click on the wheel -> click Add.. -> On the left side, click System Interpreter -> click on the three dots box, on the right side of the 'Interpreter' path box -> click on the 'eye' button, to show hidden files -> find your python path (in my case c:\users\yourname\appdata\local\programs\python\python37\pythonw.exe) -> click on the pythonw.exe file -> click Ok -> Ok -> Ok.

Basically, the system interpreter has to be pythonw.exe, instead of python.exe




回答2:


Looks like pycharm is starting the interpreter with a --mode argument. Kivy tries to parse all the args and doesn't like that argument (this is actually a bug, Kivy should be more intelligent, but that doesn't help here). You probably want to work out why PyCharm passes this argument, and tell it not to.



来源:https://stackoverflow.com/questions/57460216/error-core-option-mode-not-recognized-importing-kivy-on-pycharm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!