2017-08-31 157 views
0

我在使用Python 3.6.0安裝Kivy(v1.10.0)時遇到問題。但它在Python 2.7.12和Python 3.5.2中工作得很好。我想與Python 3.6.0一起工作。無法使用Python 3.6.0安裝Kivy v1.10.0

我的系統:Ubuntu 16.04 64-Bit

的Python 2.7.12:

>>> import kivy 
[INFO ] [Logger  ] Record log in /home/nvs/.kivy/logs/kivy_17-08-31_5.txt 
[INFO ] [Kivy  ] v1.10.0 
[INFO ] [Python  ] v2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] 

的Python 3.5.2

>>> import kivy 
[INFO ] [Logger  ] Record log in /home/nvs/.kivy/logs/kivy_17-08-31_6.txt 
[INFO ] [Kivy  ] v1.10.0 
[INFO ] [Python  ] v3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] 

的Python 3.6.0:

>>> import kivy 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ModuleNotFoundError: No module named 'kivy' 

我跟隨刺傷的步驟le從here安裝。

我想知道如何使用Python工作Kivy 3.6.0

回答

0

你是如何安裝它的?我有工作在這裏的virtualenv中

[email protected]:/tmp> virtualenv -p python3.6 .testvenv 
Running virtualenv with interpreter /usr/bin/python3.6 
Using base prefix '/usr' 
New python executable in /tmp/.testvenv/bin/python3.6 
Also creating executable in /tmp/.testvenv/bin/python 
Installing setuptools, pkg_resources, pip, wheel...done. 

(無視這樣的事實,我使用activate.fish,因爲我用魚貝,使用正確的激活你的shell)

[email protected]:/tmp> . .testvenv/bin/activate.fish 

安裝用Cython

(.testvenv) 11:46:29 02/09/17 1,47.testvenv 0 
[email protected]:/tmp> pip install cython 
Collecting cython 
    Using cached Cython-0.26.1-cp36-cp36m-manylinux1_x86_64.whl 
Installing collected packages: cython 
Successfully installed cython-0.26.1 

終於安裝kivy

[email protected]:/tmp> pip install kivy 
Collecting kivy 
    Using cached Kivy-1.10.0.tar.gz 
Collecting Kivy-Garden>=0.1.4 (from kivy) 
Collecting docutils (from kivy) 
    Using cached docutils-0.14-py3-none-any.whl 
Collecting pygments (from kivy) 
    Using cached Pygments-2.2.0-py2.py3-none-any.whl 
Collecting requests (from Kivy-Garden>=0.1.4->kivy) 
    Using cached requests-2.18.4-py2.py3-none-any.whl 
Collecting urllib3<1.23,>=1.21.1 (from requests->Kivy-Garden>=0.1.4->kivy) 
    Using cached urllib3-1.22-py2.py3-none-any.whl 
Collecting certifi>=2017.4.17 (from requests->Kivy-Garden>=0.1.4->kivy) 
    Using cached certifi-2017.7.27.1-py2.py3-none-any.whl 
Collecting idna<2.7,>=2.5 (from requests->Kivy-Garden>=0.1.4->kivy) 
    Using cached idna-2.6-py2.py3-none-any.whl 
Collecting chardet<3.1.0,>=3.0.2 (from requests->Kivy-Garden>=0.1.4->kivy) 
    Using cached chardet-3.0.4-py2.py3-none-any.whl 
Building wheels for collected packages: kivy 
    Running setup.py bdist_wheel for kivy ... done 
    Stored in directory: /home/gabriel/.cache/pip/wheels/44/dc/e1/8f36be467f9d8c3b27d172a64a55b887212b86727684ca18e8 
Successfully built kivy 
Installing collected packages: urllib3, certifi, idna, chardet, requests, Kivy-Garden, docutils, pygments, kivy 
Successfully installed Kivy-Garden-0.1.4 certifi-2017.7.27.1 chardet-3.0.4 docutils-0.14 idna-2.6 kivy-1.10.0 pygments-2.2.0 requests-2.18.4 urllib3-1.22 

測試它

[email protected]:/tmp> python 
Python 3.6.1 (default, Mar 22 2017, 06:17:05) 
[GCC 6.3.0 20170321] on linux 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import kivy 
[INFO ] [Logger  ] Record log in /home/gabriel/.kivy/logs/kivy_17-09-02_1.txt 
[INFO ] [Kivy  ] v1.10.0 
[INFO ] [Python  ] v3.6.1 (default, Mar 22 2017, 06:17:05) 
[GCC 6.3.0 20170321] 
>>> 
+0

嗨,你可以看看我剛剛發佈的答案嗎?在你的回答中,我看到你已經使用了Cython == 0.26.1。我嘗試了0.27,但失敗了,所以我按照Kivy安裝頁面中的建議回滾到了0.25。你能否指點我如何檢查Kivy是否可以用於更新版本的Cython?是否有一個腳本可以運行這樣的測試,或者你能指導我如何做到這一點?我們需要它用於我們的產品,它也一定會幫助Kivy社區。謝謝 – yoel

+0

我不認爲我們有新的cython發行版的系統測試,他們傾向於破壞東西(畢竟,它仍然不是1.0 ...),所以我們不得不修補東西並不罕見。在新的Kivy提交*和*新的Cython版本中引入一些CI可能會很好,以瞭解這些問題。不知道在哪裏做的最好,也許你可以在freenode上通過#kivy-dev來討論它? – Tshirtman

1

同樣的事情發生在我身上。 閱讀註釋here之一後,我安裝了幾個包,以得到它的工作(不知道是否所有的人都需要)

apt-get install python3.6 idle-python3.6 python3.6-doc python3.6-examples libpython3.6 libpython3.6-stdlib python-clang-3.6 python-lldb-3.6 libpython3.6-dbg python3.6-venv

於是,我做了一個新的virtualenv和專門安裝用Cython == 0.25.2:

mkvirtualenv kivyinstall -p python3.6 workon kivyinstall pip install Cython==0.25.2 pip install Kivy==1.10.0

這個工作。不幸的是,使用最新的Cython版本並不適合我。 我想知道這將由基維傢伙測試。在Kivy's installation page中寫道,Cython == 0.25是推薦的版本,但是從那時起Cython就開始了。