ネットワークやインターネットなしでpipをインストールする方法

ネットワークやインターネットなしでpipをインストールする方法

Redhat 7.5バージョンでは、次の方法でpipをインストールしました。

pip-8.1.2-py2.py3-none-any.whlインターネットのないコンピュータにpkgをダウンロードしました。

私がインストールした

python /root/pip-8.1.2-py2.py3-none-any.whl/pip install /root/pip-8.1.2-py2.py3-none-any.whl

しかし、これがpipをインストールする正しい方法であるかどうかはわかりません。

私たちは合格しようとしています -

clone https://github.com/psf/requests.git

次に、ネットワークがないコンピュータにファイルをコピーします。

それから

python setup.py install

しかし、これを行うとエラーが発生するため、そのまま残ります。

最後の行にエラーがあります

とにかく、私たちはこの方法がインターネットネットワークを取得しようとする不明な理由を知ることができます。

python setup.py install
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'project_urls'
  warnings.warn(msg)
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
  warnings.warn(msg)
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'
  warnings.warn(msg)
running install
running bdist_egg
running egg_info
writing requirements to requests.egg-info/requires.txt
writing requests.egg-info/PKG-INFO
writing top-level names to requests.egg-info/top_level.txt
writing dependency_links to requests.egg-info/dependency_links.txt
reading manifest file 'requests.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'NOTICE'
warning: no files found matching 'requirements.txt'
writing manifest file 'requests.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/__init__.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/__version__.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/_internal_utils.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/adapters.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/api.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/auth.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/certs.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/compat.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/cookies.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/exceptions.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/help.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/hooks.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/models.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/packages.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/sessions.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/status_codes.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/structures.py -> build/bdist.linux-x86_64/egg/requests
copying build/lib/requests/utils.py -> build/bdist.linux-x86_64/egg/requests
byte-compiling build/bdist.linux-x86_64/egg/requests/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/__version__.py to __version__.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/_internal_utils.py to _internal_utils.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/adapters.py to adapters.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/api.py to api.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/auth.py to auth.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/certs.py to certs.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/compat.py to compat.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/cookies.py to cookies.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/exceptions.py to exceptions.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/help.py to help.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/hooks.py to hooks.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/models.py to models.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/packages.py to packages.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/sessions.py to sessions.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/status_codes.py to status_codes.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/structures.py to structures.pyc
byte-compiling build/bdist.linux-x86_64/egg/requests/utils.py to utils.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying requests.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying requests.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying requests.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying requests.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
copying requests.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying requests.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
creating 'dist/requests-2.22.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing requests-2.22.0-py2.7.egg
removing '/usr/lib/python2.7/site-packages/requests-2.22.0-py2.7.egg' (and everything under it)
creating /usr/lib/python2.7/site-packages/requests-2.22.0-py2.7.egg
Extracting requests-2.22.0-py2.7.egg to /usr/lib/python2.7/site-packages
requests 2.22.0 is already the active version in easy-install.pth

Installed /usr/lib/python2.7/site-packages/requests-2.22.0-py2.7.egg
Processing dependencies for requests==2.22.0
Searching for urllib3>=1.21.1,!=1.25.0,!=1.25.1,<1.26
Reading https://pypi.python.org/simple/urllib3/
Best match: urllib3 1.25.6
Downloading https://files.pythonhosted.org/packages/ff/44/29655168da441dff66de03952880c6e2d17b252836ff1aa4421fba556424/urllib3-1.25.6.tar.gz#sha256=9a107b99a5393caf59c7aa3c1249c16e6879447533d0887f4336dde834c7be86
Processing urllib3-1.25.6.tar.gz
Writing /tmp/easy_install-WI5FBQ/urllib3-1.25.6/setup.cfg
Running urllib3-1.25.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-WI5FBQ/urllib3-1.25.6/egg-dist-tmp-tEDlGM
error: Setup script exited with error in urllib3 setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.

答え1

最新の pip バージョンを使用して応答します。

setuptoolszipファイルのダウンロードここから:

wget https://files.pythonhosted.org/packages/f4/d5/a6c19dcbcbc267aca376558797f036d9bcdff344c9f785fe7d0fe9a5f2a7/setuptools-41.4.0.zip

解凍し、ディレクトリを変更してインストールします。python setup.py install

ダウンロードpip ここから:

wget https://files.pythonhosted.org/packages/ce/ea/9b445176a65ae4ba22dce1d93e4b5fe182f953df71a145f557cffaffc1bf/pip-19.3.1.tar.gz

解凍し、ディレクトリを変更してインストールします。python setup.py install

以前のpipバージョンでは、次のことができます。ここで発見ポイント8.1.2

以前のsetuptoolsバージョンでは、次のことができます。ここで発見インストールツール20.0.0

リリースノート

関連情報