Wie bekomme ich Urllib3 und Requests mit Jython 2.7 Beta 1?

Schlaue Leute,

Ich möchte das fantastische Anforderungsmodul in meinem Jython-Programm verwenden. Es installiert und läuft in Python einwandfrei, aber ich kann es nicht in Jython installieren. Ich habe Jython 2.7a2 und 2.7b1 auf Mac und Ubuntu ausprobiert und erhalte die gleichen Fehler im Zusammenhang mit urllib3.

Installiere zuerst ez_setup.py wie in erwähntWie kann ich jython setup.py installieren?

Führen Sie anschließend easy_install im Verzeichnis jython bin aus, was zu folgenden Ausnahmen führt:

NameError: name 'CERT_NONE' is not defined
gautam-mbp:bin gautam$ ./easy_install requests
Searching for requests
Reading http://pypi.python.org/simple/requests/
Reading http://python-requests.org
Reading https://github.com/kennethreitz/requests
Best match: requests 1.1.0
Downloading http://pypi.python.org/packages/source/r/requests/requests-1.1.0.tar.gz#md5=a0158815af244c32041a3147ee09abf3
Processing requests-1.1.0.tar.gz
Running requests-1.1.0/setup.py -q bdist_egg --dist-dir /var/folders/jf/cb2pc45s7d94hd6sndysvyxw0000gn/T/easy_install-MnOao_/requests-1.1.0/egg-dist-tmp-E2Rkg1
Traceback (most recent call last):
  File "./easy_install", line 7, in <module>
    sys.exit(
  File "/Users/gautam/jython27b1/Lib/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1712, in main
  File "/Users/gautam/jython27b1/Lib/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
  File "/Users/gautam/jython27b1/Lib/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1712, in <lambda>
-----------lots of stack trace---------------
  File "setup.py", line 6, in <module>
  File "/var/folders/jf/cb2pc45s7d94hd6sndysvyxw0000gn/T/easy_install-MnOao_/requests-1.1.0/requests/__init__.py", line 52, in <module>
  File "/var/folders/jf/cb2pc45s7d94hd6sndysvyxw0000gn/T/easy_install-MnOao_/requests-1.1.0/requests/utils.py", line 23, in <module>
  File "/var/folders/jf/cb2pc45s7d94hd6sndysvyxw0000gn/T/easy_install-MnOao_/requests-1.1.0/requests/compat.py", line 7, in <module>
  File "/var/folders/jf/cb2pc45s7d94hd6sndysvyxw0000gn/T/easy_install-MnOao_/requests-1.1.0/requests/packages/__init__.py", line 3, in <module>
  File "/var/folders/jf/cb2pc45s7d94hd6sndysvyxw0000gn/T/easy_install-MnOao_/requests-1.1.0/requests/packages/urllib3/__init__.py", line 16, in <module>
  File "/var/folders/jf/cb2pc45s7d94hd6sndysvyxw0000gn/T/easy_install-MnOao_/requests-1.1.0/requests/packages/urllib3/connectionpool.py", line 45, in <module>
  File "/var/folders/jf/cb2pc45s7d94hd6sndysvyxw0000gn/T/easy_install-MnOao_/requests-1.1.0/requests/packages/urllib3/util.py", line 293, in <module>
NameError: name 'CERT_NONE' is not defined

Sieht nach einem Problem aus, das damit zusammenhängt, dass urllib3 nicht mit Jython funktioniert. Schätzen Sie die Hilfe, um Anfragen (und urllib3) dazu zu bringen, mit Jython zu arbeiten. Der gleiche Fehler tritt auch bei Ubuntu auf.

Danke Gautam

Antworten auf die Frage(2)

Ihre Antwort auf die Frage