java - 无法在 jython 中安装请求

标签 java python jython

我已经通过安装 pip

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

命令,但是当我尝试通过 jython 安装请求时,它显示以下错误

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


最佳答案

official repo 下载 requests-2.25.1.tar.gz ,然后转到终端中的该目录, 并输入以下命令:

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

这将在 jython 中安装请求。

关于java - 无法在 jython 中安装请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67563505/

相关文章:

java - Jenkins 中的构建问题

python - 在类中应用装饰器所有函数而不使用元类

android - Monkeyrunner 脚本不运行,但命令有效

java - 当我将 Enum 实例变量设置为作为选项包含在 Enum 类本身中的值时,它无法解析为类型。为什么?

java - 从字符串中提取电话号码

python - 保存抓取的项目和文件时,Scrapy 在输出 csv 文件中插入空行

python - 在 SciPy 中使用固定参数拟合分布

python - 将键复制到新字典 (Python)

java - 只需导入一次即可通过 Java 运行 Python 脚本

java - 按照模式指定的顺序在序列下的 XML 中插入元素