web-dev-qa-db-ja.com

Windowsでpython 2.6を使用してpipをインストールする方法

python 2.6を使用するデプロイメント環境と一致させるために、開発マシンにpython 2.6でpipをインストールしようとしています。

Python2.6は正常にインストールされています。ここで概説されているように、get-pip.pyを使用してpipをインストールしようとしました https://pip.pypa.io/en/stable/installing/ からのget-pip.pyスクリプトのバージョン https://bootstrap.pypa.io/2.6/get-pip.py

ただし、次の場合は失敗します。

C:\users\me> python get-pip.py
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting pip<10
c:\users\me\appdata\local\temp\tmpcdimtd\pip.Zip\pip\_vendor\urllib3\util\ssl_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
c:\users\me\appdata\local\temp\tmpcdimtd\pip.Zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\me\appdata\local\temp\tmpcdimtd\pip.Zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\me\appdata\local\temp\tmpcdimtd\pip.Zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\me\appdata\local\temp\tmpcdimtd\pip.Zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\me\appdata\local\temp\tmpcdimtd\pip.Zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\me\appdata\local\temp\tmpcdimtd\pip.Zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(Host='pypi.python.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping
  Could not find a version that satisfies the requirement pip<10 (from versions: )
No matching distribution found for pip<10

明らかに、新しいpythonにアップグレードすると私の目的が無効になります。

[〜#〜] url [〜#〜] 警告に推奨される情報InsecurePlatformWarningは、pipを使用してさらに多くのものをインストールすることを示唆しています...>。<

[〜#〜] ps [〜#〜]setuptools-40.0.0からのeasy-installも使用してみましたが、できませんでしたこれを機能させます。 setuptoolsのインストールドキュメントには循環リンクがあるため、正しく使用しているかどうかはわかりません(ドキュメントからPypiへ、ドキュメントへ戻る)

4
Toby

Python 2.6の場合、古いsetuptoolsが必要です。Python 2.6で動作する最後のsetuptoolsバージョンは 6.8 です。

ダウンロード setuptools-36.8.0.Zip 、解凍して実行python2.6 setup.py install

その後 get-pip.pypipをインストールする必要があります。

Python 2.6をサポートするpipの最後のバージョンは 9.0.https://pypi.org/project/pip/ 9.0.3 /#files

6
phd