python 3环境下,离线安装模块(modules)

说明

  需要在环境中安装python的模块,但是无法联网,就通过在Pypi上下载离线模块的包进行安装

安装过程

1.下载模块,如PyMySQL-0.9.3.tar.gz,下载地址:https://files.pythonhosted.org/packages/da/15/23ba6592920e21cb40eb0fe0ea002d2b6177beb1ca8a4c1add5a8f32754d/PyMySQL-0.9.3.tar.gz

2.上传至服务器,并解压缩

3.通过python命令执行安装

python3 setup.py install

安装日志:

[aiprd@hadoop3 PyMySQL-0.9.3]$ python3 setup.py install
running install
running bdist_egg
running egg_info
writing PyMySQL.egg-info/PKG-INFO
writing dependency_links to PyMySQL.egg-info/dependency_links.txt
writing requirements to PyMySQL.egg-info/requires.txt
writing top-level names to PyMySQL.egg-info/top_level.txt
reading manifest file 'PyMySQL.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'PyMySQL.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/pymysql
copying pymysql/protocol.py -> build/lib/pymysql
copying pymysql/connections.py -> build/lib/pymysql
copying pymysql/err.py -> build/lib/pymysql
copying pymysql/optionfile.py -> build/lib/pymysql
copying pymysql/_socketio.py -> build/lib/pymysql
copying pymysql/_compat.py -> build/lib/pymysql
copying pymysql/__init__.py -> build/lib/pymysql
copying pymysql/times.py -> build/lib/pymysql
copying pymysql/cursors.py -> build/lib/pymysql
copying pymysql/converters.py -> build/lib/pymysql
copying pymysql/util.py -> build/lib/pymysql
copying pymysql/charset.py -> build/lib/pymysql
copying pymysql/_auth.py -> build/lib/pymysql
creating build/lib/pymysql/constants
copying pymysql/constants/CLIENT.py -> build/lib/pymysql/constants
copying pymysql/constants/SERVER_STATUS.py -> build/lib/pymysql/constants
copying pymysql/constants/CR.py -> build/lib/pymysql/constants
copying pymysql/constants/FIELD_TYPE.py -> build/lib/pymysql/constants
copying pymysql/constants/__init__.py -> build/lib/pymysql/constants
copying pymysql/constants/FLAG.py -> build/lib/pymysql/constants
copying pymysql/constants/COMMAND.py -> build/lib/pymysql/constants
copying pymysql/constants/ER.py -> build/lib/pymysql/constants
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/pymysql
copying build/lib/pymysql/protocol.py -> build/bdist.linux-x86_64/egg/pymysql
copying build/lib/pymysql/connections.py -> build/bdist.linux-x86_64/egg/pymysql
copying build/lib/pymysql/err.py -> build/bdist.linux-x86_64/egg/pymysql
copying build/lib/pymysql/optionfile.py -> build/bdist.linux-x86_64/egg/pymysql
copying build/lib/pymysql/_socketio.py -> build/bdist.linux-x86_64/egg/pymysql
copying build/lib/pymysql/_compat.py -> build/bdist.linux-x86_64/egg/pymysql
copying build/lib/pymysql/__init__.py -> build/bdist.linux-x86_64/egg/pymysql
copying build/lib/pymysql/times.py -> build/bdist.linux-x86_64/egg/pymysql
creating build/bdist.linux-x86_64/egg/pymysql/constants
copying build/lib/pymysql/constants/CLIENT.py -> build/bdist.linux-x86_64/egg/pymysql/constants
copying build/lib/pymysql/constants/SERVER_STATUS.py -> build/bdist.linux-x86_64/egg/pymysql/constants
copying build/lib/pymysql/constants/CR.py -> build/bdist.linux-x86_64/egg/pymysql/constants
copying build/lib/pymysql/constants/FIELD_TYPE.py -> build/bdist.linux-x86_64/egg/pymysql/constants
copying build/lib/pymysql/constants/__init__.py -> build/bdist.linux-x86_64/egg/pymysql/constants
copying build/lib/pymysql/constants/FLAG.py -> build/bdist.linux-x86_64/egg/pymysql/constants
copying build/lib/pymysql/constants/COMMAND.py -> build/bdist.linux-x86_64/egg/pymysql/constants
copying build/lib/pymysql/constants/ER.py -> build/bdist.linux-x86_64/egg/pymysql/constants
copying build/lib/pymysql/cursors.py -> build/bdist.linux-x86_64/egg/pymysql
copying build/lib/pymysql/converters.py -> build/bdist.linux-x86_64/egg/pymysql
copying build/lib/pymysql/util.py -> build/bdist.linux-x86_64/egg/pymysql
copying build/lib/pymysql/charset.py -> build/bdist.linux-x86_64/egg/pymysql
copying build/lib/pymysql/_auth.py -> build/bdist.linux-x86_64/egg/pymysql
byte-compiling build/bdist.linux-x86_64/egg/pymysql/protocol.py to protocol.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/connections.py to connections.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/err.py to err.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/optionfile.py to optionfile.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/_socketio.py to _socketio.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/_compat.py to _compat.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/times.py to times.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/constants/CLIENT.py to CLIENT.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/constants/SERVER_STATUS.py to SERVER_STATUS.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/constants/CR.py to CR.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/constants/FIELD_TYPE.py to FIELD_TYPE.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/constants/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/constants/FLAG.py to FLAG.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/constants/COMMAND.py to COMMAND.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/constants/ER.py to ER.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/cursors.py to cursors.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/converters.py to converters.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/util.py to util.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/charset.py to charset.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/pymysql/_auth.py to _auth.cpython-37.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying PyMySQL.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying PyMySQL.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying PyMySQL.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying PyMySQL.egg-info/pbr.json -> build/bdist.linux-x86_64/egg/EGG-INFO
copying PyMySQL.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying PyMySQL.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/PyMySQL-0.9.3-py3.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing PyMySQL-0.9.3-py3.7.egg
Copying PyMySQL-0.9.3-py3.7.egg to /home/aiprd/app/python-3.7.4/lib/python3.7/site-packages
Adding PyMySQL 0.9.3 to easy-install.pth file

Installed /home/aiprd/app/python-3.7.4/lib/python3.7/site-packages/PyMySQL-0.9.3-py3.7.egg
Processing dependencies for PyMySQL==0.9.3
Finished processing dependencies for PyMySQL==0.9.3

 

4.查看模块信息

[aiprd@hadoop3 PyMySQL-0.9.3]$ pydoc3 modules | grep mysql
_testbuffer         ftplib              pymysql             weakref

 

说明已经安装完成

 

文档创建时间:2019年8月26日15:32:54

posted @ 2019-08-26 15:34  Zhai_David  阅读(6162)  评论(0编辑  收藏  举报