pip install "numpy" 导致 android chaquopy 出错

pip install "numpy" causing error in android chaquopy

您好,我一直在尝试将 chaquopy 用于 运行 我的 python 脚本,但我在导入部分遇到了问题。当我 运行 一个不需要任何外部库并且不使用您将在 build.gradle.

中编写的安装代码的脚本时,它工作正常
        python{
            pip{
                install "numpy"
            }
        }

我一输入安装代码就出现了问题。它出现了下面写的错误消息。

> Task :app:generateDebugPythonRequirements
C:\Users\q\AndroidStudioProjects\Chaquopy_Practice\app\build\generated\python\bp.zip\pip\_vendor\ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
C:\Users\q\AndroidStudioProjects\Chaquopy_Practice\app\build\generated\python\bp.zip\pip\_vendor\ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
Chaquopy: Installing for armeabi-v7a
C:\Users\q\AndroidStudioProjects\Chaquopy_Practice\app\build\generated\python\bp.zip\pip\_vendor\ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
C:\Users\q\AndroidStudioProjects\Chaquopy_Practice\app\build\generated\python\bp.zip\pip\_vendor\ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Looking in indexes: https://pypi.org/simple, https://chaquo.com/pypi-7.0
Collecting numpy
  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/numpy/
  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/numpy/
  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/numpy/
  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/numpy/
  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/numpy/
  Could not fetch URL https://pypi.org/simple/numpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
  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.")': /pypi-7.0/numpy/
  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.")': /pypi-7.0/numpy/
  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.")': /pypi-7.0/numpy/
  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.")': /pypi-7.0/numpy/
  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.")': /pypi-7.0/numpy/
  Could not fetch URL https://chaquo.com/pypi-7.0/numpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='chaquo.com', port=443): Max retries exceeded with url: /pypi-7.0/numpy/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
  Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy
Chaquopy: Exit status 1

我认为 SSLError 发生在其他一些人身上,但我找不到 SyntaxWarning: 'str' object ~~ 是关于什么的。

问题本身不在 pip install 命令中。 真正的问题来自使用来自 anaconda 的 python.exe 而不是原始的 python.exe。 下载 python 3.8.6 并更改构建 python 路径后,我能够解决问题。