gpt4 book ai didi

python - 在命令行上为 IronPython 安装 pip

转载 作者:行者123 更新时间:2023-11-28 19:20:16 25 4
gpt4 key购买 nike

是否可以通过命令行在 IronPython 中安装和使用 pip? (我不是通过 PTVS 这样做的。)

我已经尝试过的事情:

  • 查看了这个 SO 问题:Installing Python Packages - IronPython ,但已超过一年未得到答复或更新。
  • 查看了这个答案on Yahoo ,但指向 distribute_setup.py 的链接已损坏。我从这里得到了一份副本:distribute_setup.py ,它以此结束:

    IOError: System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
  • 查看 pip docs ,但这显然适用于 CPython,而不是 IronPython。

  • 遵循 Steps to installing setuptools on IronPython 上的步骤.根据评论,去年8月份就可以运行了,但是我报了和上面一样的错误:

    IOError: System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
  • 查看这些错误的完整输出。它似乎捡起了鸡蛋,但后来在调用 urllib2.urlopen(url) 的过程中失败了:

    Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
    Traceback (most recent call last):
    File "ez_setup.py", line 158, in download_setuptools
    File "C:\Program Files (x86)\IronPython 2.7\Lib\urllib2.py", line 126, in urlopen
    File "C:\Program Files (x86)\IronPython 2.7\Lib\urllib2.py", line 400, in open
    File "C:\Program Files (x86)\IronPython 2.7\Lib\urllib2.py", line 512, in http_response
    File "C:\Program Files (x86)\IronPython 2.7\Lib\urllib2.py", line 432, in error
    File "C:\Program Files (x86)\IronPython 2.7\Lib\urllib2.py", line 372, in _call_chain
    File "C:\Program Files (x86)\IronPython 2.7\Lib\urllib2.py", line 619, in http_error_302
    File "C:\Program Files (x86)\IronPython 2.7\Lib\urllib2.py", line 394, in open
    File "C:\Program Files (x86)\IronPython 2.7\Lib\urllib2.py", line 411, in _open
    File "C:\Program Files (x86)\IronPython 2.7\Lib\urllib2.py", line 372, in _call_chain
    File "C:\Program Files (x86)\IronPython 2.7\Lib\urllib2.py", line 1168, in do_open
    File "C:\Program Files (x86)\IronPython 2.7\Lib\httplib.py", line 955, in request
    File "C:\Program Files (x86)\IronPython 2.7\Lib\httplib.py", line 951, in endheaders
    File "C:\Program Files (x86)\IronPython 2.7\Lib\httplib.py", line 811, in _send_output
    File "C:\Program Files (x86)\IronPython 2.7\Lib\httplib.py", line 1158, in connect
    File "C:\Program Files (x86)\IronPython 2.7\Lib\ssl.py", line 366, in wrap_socket
    File "C:\Program Files (x86)\IronPython 2.7\Lib\ssl.py", line 133, in __init__
    File "C:\Program Files (x86)\IronPython 2.7\Lib\ssl.py", line 295, in do_handshake
    File "ez_setup.py", line 278, in <module>
    File "ez_setup.py", line 210, in main
    File "C:\Program Files (x86)\IronPython 2.7\Lib\urllib2.py", line 1207, in https_open
    File "C:\Program Files (x86)\IronPython 2.7\Lib\httplib.py", line 989, in _send_request
    File "C:\Program Files (x86)\IronPython 2.7\Lib\httplib.py", line 773, in send
    IOError: System.IO.IOException: Authentication failed because the remote party has closed the transport stream.

关于还可以尝试什么的任何想法,或者这是否可能奏效?

最佳答案

我在硬盘驱动器上安装了常规 (CPython) 并设置了 IronPython 引擎搜索路径 Importing external module in IronPython到它的 Lib 和 Lib\site-packages 目录。然后我可以将包安装到 CPython 中并在我的 IronPython 脚本中使用它们。不过,这可能不适用于每个包。

关于python - 在命令行上为 IronPython 安装 pip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26734815/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com