- Learning Python for Forensics
- Preston Miller Chapin Bryce
- 282字
- 2021-08-20 10:17:05
Installing third-party libraries
We know that we do not need to install standard modules because they come with Python, but what about third-party modules? The Python Package Index is a great place to start looking for third-party libraries. This can be found at https://pypi.org/. This service allows tools, such as pip, to install packages automatically. If an internet connection is not available or the package is not found on PyPi, a setup.py file can usually be used to install the module manually. The examples of using pip and setup.py are shown later. Tools such as pip are very convenient as they handle the installation of dependencies, check whether items are already installed, and suggest upgrades if an older version is installed. An internet connection is required to check for online resources, such as dependencies and newer versions of a module; however, pip can also be used to install code on an offline machine.
These commands are run in the Terminal or Command Prompt, not the Python interpreter. Please note that in the example mentioned below, full paths may be necessary if your Python executable is not included in the current environment's PATH variable. pip may need to be run from an elevated console, either using sudo or an elevated Windows Command Prompt. Full documentation for pip can be found at http://pip.pypa.io/en/stable/reference/pip/:
$ pip install python-registry==1.0.4
Collecting python-registry
Collecting enum34 (from python-registry)
Using cached https://files.pythonhosted.org/packages/af/42/cb9355df32c69b553e72a2e28daee25d1611d2c0d9c272aa1d34204205b2/enum34-1.1.6-py3-none-any.whl
Installing collected packages: enum34, python-registry
Successfully installed enum34-1.1.6 python-registry-1.0.4
$ pip install yarp==1.0.17
https://github.com/msuhanov/yarp/archive/1.0.17.tar.gz
Collecting https://github.com/msuhanov/yarp/archive/1.0.17.tar.gz
Downloading https://github.com/msuhanov/yarp/archive/1.0.17.tar.gz
\ 716kB 12.8MB/s
Building wheels for collected packages: yarp
Running setup.py bdist_wheel for yarp ... done
Stored in directory: C:\USERS\...\APPDATA\LOCAL\TEMP\pip-ephem-wheel-cache-78qdzfmy\wheels\........
Successfully built yarp
Installing collected packages: yarp
Successfully installed yarp-1.0.17
- Node Security
- 黑客大曝光:無線網(wǎng)絡(luò)安全(原書第3版)
- 網(wǎng)絡(luò)空間攻防技術(shù)原理
- 白帽子講Web安全(紀(jì)念版)
- 信息系統(tǒng)安全檢測(cè)與風(fēng)險(xiǎn)評(píng)估
- API攻防:Web API安全指南
- 軟件開發(fā)安全之道:概念、設(shè)計(jì)與實(shí)施
- 網(wǎng)絡(luò)安全三十六計(jì):人人該懂的防黑客技巧
- 信息安全等級(jí)保護(hù)測(cè)評(píng)與整改指導(dǎo)手冊(cè)
- 數(shù)據(jù)保護(hù):工作負(fù)載的可恢復(fù)性
- 網(wǎng)絡(luò)關(guān)鍵設(shè)備安全檢測(cè)實(shí)施指南
- 博弈論與數(shù)據(jù)安全
- 捍衛(wèi)隱私
- 復(fù)雜信息系統(tǒng)網(wǎng)絡(luò)安全體系建設(shè)指南
- 黑客攻防從入門到精通:命令版