在命令行上安装IronPython的pip

4

你是否可以通过命令行安装和使用IronPython的pip?(我不是通过PTVS进行操作。)

我已经尝试过以下几个方法:

  • Looked at this SO question: Installing Python Packages - IronPython, but it hasn't been answered or updated for more than a year.
  • Looked at this answer on Yahoo, but the link to distribute_setup.py is broken. I got a copy from here: distribute_setup.py, it terminates with this:

    IOError: System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
    
  • Taken a look at the pip docs, but this is obviously for CPython, not IronPython.

  • Followed the steps on Steps to installing setuptools on IronPython. According to the comments, it worked in August last year, but I got the same error as above:

    IOError: System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
    
  • Taken a look at the full output of these errors. It seems to pick up the egg, but fails later on in the process during a call to 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.
    

你有没有其他想法可以尝试,或者这种方法可能行吗?


请检查http://stackoverflow.com/questions/26663366/python-tools-for-visual-studio-cant-download-setuptools-on-ironpython上的Python Tools for Visual Studio,IronPython无法下载setuptools。 - Pawel Jasinski
谢谢@PawelJasinski!我尝试过了,但没有使用IronPython 2.7.5b3。我猜这个问题应该被标记为重复,但我不认为我有足够的声望来这样做。 - Captain Whippet
1个回答

1

我在硬盘上安装了常规的CPython,并将我的IronPython引擎的setsearchpaths Importing external module in IronPython设置为其Lib和Lib\site-packages目录。然后,我可以在CPython中安装包并在我的IronPython脚本中使用它们。但是,这种方法可能不适用于每个包。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接