<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ### 用戶向導3.1安裝 我們不要總是重新制造各種輪子,但我們要試著做一些創新的東西;因此,我們要盡可能的使用現存的、高質量的第三方庫。為了支持全部的、豐富的Kivy的特色功能,其它幾個庫是需要首先進行安裝的。如果你不需要一些特殊的功能(例如視頻回放等),那么你可以不安裝相應的依賴。但是有一個依賴庫是必須安裝的:Cython。 當前版本至少需要Cython v0.20,并且已經在v0.23下測試通過。較新的版本可能能夠運行,但是由于沒有進行測試,因此不能保證流暢運行。 另外,你需要Python(2.7 <= x < 3.0)或者(3.3 <= x),如果你想使用窗口相關(比如打開一個窗口),音頻/視頻回放或者拼寫檢查等功能,額外的依賴必須安裝。對于這些,我們推薦SDSL2,Gstreamer 1.x和PyEnchant,respectively。 其它一些庫有: * OpenCV 2.0:攝像頭輸入 * Pillow:圖像和文本顯示 * PyEnchant:拼寫檢查 ###### 不要恐慌 我們不希望你自己安裝這些庫。我們已經創建好了你可以直接使用的包庫,并且它們包含了目標平臺的所需的依賴庫。我們僅僅想讓你知道它們是可選擇的,同時為你作了一個關于Kivy內部使用的包庫的大致預覽。 #### 一、穩定版本 Kivy的最新穩定版本可以在[http://kivy.org/#download](http://kivy.org/#download)找到,請針對你的系統平臺參閱相關的安裝說明。 * [在Windows平臺上安裝Kivy](https://kivy.org/docs/installation/installation-windows.html) * [安裝](https://kivy.org/docs/installation/installation-windows.html#installation) * [安裝最新的輪子](https://kivy.org/docs/installation/installation-windows.html#nightly-wheel-installation) * [Kivy的依賴](https://kivy.org/docs/installation/installation-windows.html#kivy-s-dependencies) * [什么是wheels,pip和wheel](https://kivy.org/docs/installation/installation-windows.html#what-are-wheels-pip-and-wheel) * [命令行](https://kivy.org/docs/installation/installation-windows.html#command-line) * [使用開發站版Kivy](https://kivy.org/docs/installation/installation-windows.html#use-development-kivy) * [安裝Kivy到一個變動的位置](https://kivy.org/docs/installation/installation-windows.html#installing-kivy-to-an-alternate-location) * [使Python任何地方都可以使用](https://kivy.org/docs/installation/installation-windows.html#making-python-available-anywhere) * [從早期的Kivy進行更新](https://kivy.org/docs/installation/installation-windows.html#upgrading-from-a-previous-kivy-dist) * [在 OS X平臺上安裝Kivy](https://kivy.org/docs/installation/installation-osx.html) * [使用 Kivy.app](https://kivy.org/docs/installation/installation-osx.html#using-the-kivy-app) * [使用 pip](https://kivy.org/docs/installation/installation-osx.html#using-pip) * [在Linux平臺上安裝Kivy](https://kivy.org/docs/installation/installation-linux.html) * [使用 software packages](https://kivy.org/docs/installation/installation-linux.html#using-software-packages) * [在虛擬環境上安裝Kivy](https://kivy.org/docs/installation/installation-linux.html#installation-in-a-virtual-environment) * [共同的依賴](https://kivy.org/docs/installation/installation-linux.html#common-dependencies) * [對SDL2的依賴](https://kivy.org/docs/installation/installation-linux.html#dependencies-with-sdl2) * [對legacy PyGame的依賴](https://kivy.org/docs/installation/installation-linux.html#dependencies-with-legacy-pygame) * [從命令行開始](https://kivy.org/docs/installation/installation-linux.html#start-from-the-command-line) * [在Android平臺上安裝Kivy](https://kivy.org/docs/installation/installation-android.html) * [在Raspberry Pi上安裝Kivy](https://kivy.org/docs/installation/installation-rpi.html) * [安裝手冊 (On Raspbian Jessie)](https://kivy.org/docs/installation/installation-rpi.html#manual-installation-on-raspbian-jessie) * [安裝手冊 (On Raspbian Wheezy)](https://kivy.org/docs/installation/installation-rpi.html#manual-installation-on-raspbian-wheezy) * [KivyPie 分發](https://kivy.org/docs/installation/installation-rpi.html#kivypie-distribution) * [運行演示](https://kivy.org/docs/installation/installation-rpi.html#running-the-demo) * [改變默認到當前使用的屏幕](https://kivy.org/docs/installation/installation-rpi.html#change-the-default-screen-to-use) * [使用官方的RPI觸摸顯示](https://kivy.org/docs/installation/installation-rpi.html#using-official-rpi-touch-display) * [繼續到哪里學習](https://kivy.org/docs/installation/installation-rpi.html#where-to-go) * [在OS X平臺上解決問題](https://kivy.org/docs/installation/troubleshooting-osx.html) * [“不能找到任何可用的窗口提供者”錯誤(“Unable to find any valuable Window provider” Error)](https://kivy.org/docs/installation/troubleshooting-osx.html#unable-to-find-any-valuable-window-provider-error) * [檢測你的Pygame安裝問題(Check for Problems with Your PyGame Installation)](https://kivy.org/docs/installation/troubleshooting-osx.html#check-for-problems-with-your-pygame-installation) #### 二、開發版本 開發版本適合開發者和測試者使用。注意當運行開發版本時,在你的任務里,你正在運行潛在的錯誤代碼。為了使用開發版本,你首先需要安裝依賴;而后,你需要在你的計算機中設置Kivy以便更容易開發,請查看我們的貢獻(Contributing)文檔。 ##### (一)安裝依賴 為了安裝Kivy的依賴,請依據你的系統平臺遵循下面的向導。 ###### 1. 烏班圖(Ubuntu) 對于烏班圖V12.04或更高(測試到V14.04),僅僅需要輸入下面的命令來安裝所需的包: ``` $ sudo apt-get install python-setuptools python-pygame python-opengl \ python-gst0.10 python-enchant gstreamer0.10-plugins-good python-dev \ build-essential libgl1-mesa-dev-lts-quantal libgles2-mesa-dev-lts-quantal\ python-pip ``` 對于烏班圖V15.04和老于V12.04的版本,下面的方法應該可以工作: ``` $ sudo apt-get install python-setuptools python-pygame python-opengl \ python-gst0.10 python-enchant gstreamer0.10-plugins-good python-dev \ build-essential libgl1-mesa-dev libgles2-mesa-dev zlib1g-dev python-pip ``` Kivy需要一個較新版本的Cpython,因此,從pypi獲取最新的版本是較好的辦法: ``` $ sudo pip install --upgrade Cython==0.23 ``` ###### 2. OS X 你可以在終端控制臺輸入以下命令來配置Kivy的依賴: ``` curl -O -L https://www.libsdl.org/release/SDL2-2.0.4.dmg curl -O -L https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.1.dmg curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg curl -O -L https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.13.dmg curl -O -L http://gstreamer.freedesktop.org/data/pkg/osx/1.7.1/gstreamer-1.0-1.7.1-x86_64.pkg curl -O -L http://gstreamer.freedesktop.org/data/pkg/osx/1.7.1/gstreamer-1.0-devel-1.7.1-x86_64.pkg hdiutil attach SDL2-2.0.4.dmg sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/ ``` 這可能會向你請求根訪問密碼,提供給它而后在你的終端控制臺粘貼以下命令: ``` hdiutil attach SDL2_image-2.0.1.dmg sudo cp -a /Volumes/SDL2_image/SDL2_image.framework /Library/Frameworks/ hdiutil attach SDL2_ttf-2.0.13.dmg sudo cp -a /Volumes/SDL2_ttf/SDL2_ttf.framework /Library/Frameworks/ hdiutil attach SDL2_mixer-2.0.1.dmg sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/ sudo installer -package gstreamer-1.0-1.7.1-x86_64.pkg -target / sudo installer -package gstreamer-1.0-devel-1.7.1-x86_64.pkg -target / pip install --upgrade --user cython pillow ``` 現在你已經獲取了所有的Kivy依賴,你需要使用下面的命令來安裝它: ``` xcode-select --install ``` 轉到一個合適的路徑,如: ``` mkdir ~/code cd ~/code ``` 你現在可以安裝Kivy: ``` git clone http://github.com/kivy/kivy cd kivy make ``` 這將會編譯Kivy,為了在你的Python環境中可以訪問它,你需要將PYTHONPATH指向這個路徑: export PYTHONPATH=~/code/kivy:$PYTHONPATH 為了測試Kivy是否安裝成功,在你的終端窗口輸入: ``` python -c "import kivy" ``` 它可能給你一個類似如下的輸出: ``` $ python -c "import kivy" [INFO ] [Logger ] Record log in /Users/quanon/.kivy/logs/kivy_15-12-31_21.txt [INFO ] [Screen ] Apply screen settings for Motolora Droid 2 [INFO ] [Screen ] size=480x854 dpi=240 density=1.5 orientation=portrait [INFO ] [Kivy ] v1.9.1-stable [INFO ] [Python ] v2.7.10 (default, Oct 23 2015, 18:05:06) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] ``` 如果使用brew方法來安裝Kivy,需要使用homebrew來安裝依賴: ``` $ brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer ``` ###### 3. Windows 可參閱[使用開發版Kivy](https://kivy.org/docs/installation/installation-windows.html#dev-install-win) ##### (二)安裝Kivy 現在你已經安裝了所有的依賴,是時候下載和編譯一個開發版本的Kivy了: 從GitHub下載Kivy: ``` $ git clone git://github.com/kivy/kivy.git $ cd kivy ``` 編譯: ``` $ python setup.py build_ext --inplace -f ``` 如果你可以使用make命令,你也可以使用下面的簡短的命令進行編譯(和上面的命令相同): ``` $ make ``` >警告,默認情況下,Python V2.7~V2.7.2版本使用gcc編譯器,這個編譯器搭配早期版本的XCode。對于V4.2版本,僅僅clang編譯器默認搭配了XCode。這意味著,如果你使用XCode4.2及更高版本,你需要確保你至少安裝了Python 2.7.3,最好是使用最新的版本。 如果你想更新Kivy代碼,設置PYTHONPATH環境變量指向你的鏡象。這種情況下,在每一個小的更新后,你不需要使用安裝(setup.pyinstall)。Python將會從你的鏡象中導入Kivy。 相應地,如果你不想改變Kivy,你也可以運行: ``` $ python setup.py install ``` 如果你想提交代碼(補丁,新特性)到Kivy的代碼庫,請參閱[提交代碼](https://kivy.org/docs/contribute.html#contributing) ##### (三)運行測試套件 為了幫助在Kivy中測試問題和行為變動,Kivy提供了一組單元測試。當你安裝Kivy后或你想做一個改動時,就可以運行它。如果在Kivy中發生錯誤,也許測試將會顯示它們。 Kivy基于nosetest測試,你可以使用包管理或pip進行安裝: ``` $ pip install nose ``` 為了運行測試套件,可以執行: ``` $ make test ``` ##### (四)卸載Kivy 如果你安裝了多個版本的Kivy,你也許會迷惑于調用了哪個版本的Kivy。如果你已經在Python庫路徑下安裝了多個Kivy版本,請注意你需要多次執行下面的步驟: ``` $ python -c 'import kivy; print(kivy.__path__)' ``` 接下來,遞歸移除這個路徑。 如果你在Linux上使用easy_install安裝了Kivy,路徑可能包含一個'egg'的路徑,使用下面的方法來移除它: ``` $ python -c 'import kivy; print(kivy.__path__)' ['/usr/local/lib/python2.7/dist-packages/Kivy-1.0.7-py2.7-linux-x86_64.egg/kivy'] $ sudo rm -rf /usr/local/lib/python2.7/dist-packages/Kivy-1.0.7-py2.7-linux-x86_64.egg ``` 如果你使用apt-get的方式安裝了Kivy,則使用下面的命令: ``` $ sudo apt-get remove --purge python-kivy ``` ### 下節預告:3.1.2在Windows平臺上安裝Kivy
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看