错误:找不到适用于Cython的匹配分布

时间:2020-05-09 23:49:57

标签: python-3.x kivy buildozer

我正准备在寡妇10的ubuntu bash上使用buildozer和kivy构建Android应用 但我遇到这样的错误

 ERROR: Could not find a version that satisfies the requirement Cython (from versions: none)
ERROR: No matching distribution found for Cython

我不知道问题出在哪里,我该如何解决,请帮忙

完整日志

[INFO]:    -> directory context /mnt/c/users/husam/kivy_apk/.buildozer/android/platform/build-armeabi-v7a/build
[INFO]:    -> running python3 -m venv venv


[INFO]:    Upgrade pip to latest version
[INFO]:    -> running bash -c source venv/bin/activate && pip install -U pip
[INFO]:    Install Cython in case one of the modules needs it to build
[INFO]:    -> running bash -c venv/bin/pip install Cython
Exception in thread background thread for pid 1777:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg/sh.py", line 2459, in background_thread
    handle_exit_code(exit_code)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg/sh.py", line 2157, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/usr/local/lib/python3.6/dist-packages/sh-1.12.14-py3.6.egg/sh.py", line 815, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /bin/bash -c venv/bin/pip install Cython

  STDOUT:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting Cython
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/cython/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/cython/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/cython/
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/cython/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/cython/
  Could not fetch URL https://pypi.org/simple/cython/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/cython/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
  ERROR: Could not find a version that satisfies the requirement Cython (from versions: none)
ERROR: No matching distribution found for Cython
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

3 个答案:

答案 0 :(得分:1)

在我的Ubuntu VM上有同样的问题。安装libssl-dev为我解决了这个问题。

sudo apt-get update
sudo apt-get install libssl-dev

答案 1 :(得分:0)

在 CentOS 7 上有同样的问题。安装 ssl devel 包解决了这个问题。按照以下命令

sudo yum install openssl-devel buildozer android 清洁 buildozer android 调试部署运行

答案 2 :(得分:0)

当您在安装 buildozer 依赖项期间不包含 libssl-dev 时会发生这种情况。

This link 告诉 buildozer 所需的依赖项。因此,安装所有必需的依赖项的过程是:

sudo apt update
sudo apt install -y git zip unzip openjdk-8-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-dev
pip3 install --user --upgrade Cython==0.29.19 virtualenv  # the --user should be removed if you do this in a venv

# add the following line at the end of your ~/.bashrc file
export PATH=$PATH:~/.local/bin/

需要注意的重要事项

如果你没有安装这个 (libssl-dev) buildozer 依赖,最初并且已经执行了

buildozer android debug deploy run

只需使用

添加此依赖项
sudo apt-get install libssl-dev

并运行 buildozer android debug deploy run 将再次抛出相同的错误。所以改为执行这个

sudo apt-get install libssl-dev
buildozer android clean

现在你应该可以走了。