Search code examples
javapythonjython

unable to install requests in jython


i already install pip via

java -jar jython-standalone-2.7.2.jar -m ensurepip

command but when i try to install requests via jython it says following error

java -jar jython-standalone-2.7.2.jar -m pip install requests
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.python.core.io.StreamIO (file:/home/bugcracker/burp_dev/jython-standalone-2.7.2.jar) to field java.io.FilterOutputStream.out
WARNING: Please consider reporting this to the maintainers of org.python.core.io.StreamIO
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
DEPRECATION: A future version of pip will drop support for Python 2.7.
Collecting requests
  ERROR: Could not find a version that satisfies the requirement requests (from versions: none)
ERROR: No matching distribution found for requests



Solution

  • Download requests-2.25.1.tar.gz from the official repo, then go to that directory in terminal, and type the following command:

    java -jar <path-to-jython-standalone-2.7.2.jar> setup.py install
    

    This will install requests in jython.