2014-11-04 162 views
3

是否可以通過命令行安裝和使用帶有IronPython的pip? (我不是通過PTVS這樣做。)在命令行上爲IronPython安裝pip

事情我已經嘗試:

  • 看着這太問題: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上的步驟操作。根據該意見,它在八月的工作,去年,但我得到了同樣的錯誤如上:

    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. 
    

上還有什麼嘗試任何想法,或者這是可能在所有的工作?

+0

請檢查http://stackoverflow.com/questions/26663366/python-tools-for-visual-studio-cant-download-setuptools-on-ironpython – 2014-11-05 06:38:21

+0

謝謝@PawelJasinski!我曾經嘗試過,但沒有使用IronPython 2.7.5b3。我想這個問題應該標記爲重複,但我不認爲我有代表做這件事。 – 2014-11-05 10:14:40

回答

0

我在我的硬盤上安裝了常規(CPython),並將我的IronPython引擎setsearchpaths Importing external module in IronPython添加到它的Lib和Lib \ site-packages目錄中。然後,我可以將軟件包安裝到CPython中,並在我的IronPython腳本中使用它們。這可能不適用於每個包。