Python 2.7 urllib.urlretrieve未知的URL类型https

时间:2015-06-27 12:19:40

标签: android python-2.7 ubuntu kivy buildozer

我之前遇到了this error,在修好之后,我碰到了这个:

I/python  ( 7569):  Traceback (most recent call last):
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/app/main.py", line 102, in <module>
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/app/main.py", line 63, in IncarcaAfise
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 91, in urlretrieve
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 237, in retrieve
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 205, in open
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 356, in open_http
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 369, in http_error
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 632, in http_error_302
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 659, in redirect_internal
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 202, in open
I/python  ( 7569):    File "/home/cristi/Desktop/AplicatieMinister/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/urllib.py", line 214, in open_unknown
I/python  ( 7569):  IOError: [Errno url error] unknown url type: 'https'

使用了以下(相关)代码:

import urllib
urllib.urlretrieve('https://dl.dropboxusercontent.com/u/95587456/Evenimente/1.jpg','/storage/emulated/0/Temp/1.jpg')

我尝试用http替换'https',但它遇到了同样的错误。现在,经过一段时间的互联网,论坛等等,我看到人们已经通过SSL支持重新编译了Python。但是,我找不到可以解释如何完成的指南。另外,如果我要重新编译python,到目前为止我是否会丢失安装的库?

使用的操作系统是Ubuntu 14.04,带有Python 2.7,应用程序由buildozer(使用Kivy)编译并在Android上运行(来自APK)。 APK的Internet权限设置为true。

1 个答案:

答案 0 :(得分:1)

  

尝试将“openssl”添加到buildozer或p4a要求中。 - 恶意

也为我工作。被困了很久。添加以上评论作为答案,以便像我这样的其他新手可以轻松找到它