android使用kivy整合python的youtube-dl程式碼筆記

張奎勳發表於2018-12-19

brew uninstall python3  解除安裝python
brew cleanup -s  解除安裝python
brew install python3  安裝python

 

pip3 install python-for-android
pip3 install git+https://github.com/kivy/python-for-android.git
python-for-android recipes

p4a apk --private /Users/zhangkuixun/Downloads/download/python-for-android/testapps/testapp --package=org.example.myapp --name "My application" --version 0.1 --bootstrap=sdl2 --requirements=python2,kivy --arch=armeabi-v7a
1.Android NDK dir was not specified, exiting.
檢視第二個問題。
2.Android NDK dir was not specified, exiting.
在 .bash_profile 中新增
  export ANDROIDSDK="$HOME/Library/Android/sdk"
  export ANDROIDNDK="$HOME/Library/Android/sdk/android-ndk-r10e"
  export ANDROIDAPI=19  # Target API version of your application
  export NDKAPI=19  # Minimum supported API version of your application
  export ANDROIDNDKVER="r10e"  # Version of the NDK you installed
3.Couldn't find a virtualenv executable, ..., you must install this to use p4a.
  pip3 install virtualenv
4.No cython binary found. Exiting.
  pip3 install Cython
5.python setup.py install
6.OSError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1051)
  /Applications/Python\ 3.7/Install\ Certificates.command
7.ConnectionResetError: [Errno 54] Connection reset by peer
  pip3 install pyopenssl idna
8.ndk_platform doesn't exist: /Users/zhangkuixun/Library/Android/sdk/android-ndk-r10e/platforms/android-27/arch-arm
  修改序號2裡面的 ANDROIDAPI
9.sudo pip3 install sh 
  sudo pip install sh
    Collecting sh
      Could not fetch URL https://pypi.python.org/simple/sh/: There was a problem confirming the ssl 
      certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
      Could not find a version that satisfies the requirement sh (from versions: )
      No matching distribution found for sh
(1).https://pypi.org/project/sh/#files 下載sh-1...14.tar.gz
(2).sudo easy_install /.../sh-1.12.14.tar.gz 
10.pip install colorama
  Collecting colorama
    Could not fetch URL https://pypi.python.org/simple/colorama/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
    Could not find a version that satisfies the requirement colorama (from versions: )
  No matching distribution found for colorama
去這裡 https://pypi.org/project/colorama/#files 下載 colorama-0.4.1.tar.gz 
sudo easy_install /.../colorama-0.4.1.tar.gz 
11.
ERROR: The appdirs Python module could not be found, please install it.
ERROR: The jinja2 Python module could not be found, please install it.
去這裡 https://pypi.org/project/appdirs/#files 下載 appdirs-0.4.1.tar.gz 
sudo easy_install /.../appdirs-.tar.gz 

 

其他:
1.import imp
  the imp module is deprecated in favour of importlib; see the module's documentation for alternative Users
pip3 install cloudpickle

相關文章