- Geospatial Development By Example with Python
- Pablo Carreira
- 283字
- 2021-07-16 09:30:54
Python packages and package manager
A Python package is a directory containing one or more Python files (that is, modules) plus one __init__.py
file (this can be just an empty file). This file tells Python Interpreter that the directory is a package.
When writing Python code, we can import packages and modules and use them in our code. The Python community does this a lot; many packages use other packages and so on, forming an intricate network of requirements and dependencies.
In order to facilitate the installation of packages and all the requirements for it to run, Python has a package manager called pip
.
Pip looks for packages in a central repository (or on a user-defined place), downloads it, then downloads its dependencies, and installs them. Some packages also use libraries in other languages, such as C. In these cases, these libraries need to be compiled during the installation. Ubuntu users don't have problem with this because many compilers are already installed on the system, but this won't work on Windows by default.
The repository of Python packages for Windows
Python makes it easy to install libraries and packages through pip. However, since Windows doesn't include any compiler by default, the installation of packages that needs the compilation of libraries fails. Instead of going through the process of installing a compiler, which is out of this book's scope, we can get the packages ready to use.
These packages come prebuilt for various types of system and don't need a compilation of its libraries. This type of package is called a wheel
.
Note
Christoph Gohlke did a favor to all of us by building these packages and making them available for download at http://www.lfd.uci.edu/~gohlke/pythonlibs/.
- 零基礎(chǔ)搭建量化投資系統(tǒng):以Python為工具
- Objective-C應(yīng)用開發(fā)全程實(shí)錄
- 人臉識(shí)別原理及算法:動(dòng)態(tài)人臉識(shí)別系統(tǒng)研究
- Julia Cookbook
- 名師講壇:Java微服務(wù)架構(gòu)實(shí)戰(zhàn)(SpringBoot+SpringCloud+Docker+RabbitMQ)
- KnockoutJS Starter
- 搞定J2EE:Struts+Spring+Hibernate整合詳解與典型案例
- GameMaker Essentials
- Kubernetes源碼剖析
- Python 3 數(shù)據(jù)分析與機(jī)器學(xué)習(xí)實(shí)戰(zhàn)
- Python自然語(yǔ)言理解:自然語(yǔ)言理解系統(tǒng)開發(fā)與應(yīng)用實(shí)戰(zhàn)
- 奔跑吧 Linux內(nèi)核
- IPython Interactive Computing and Visualization Cookbook
- Web開發(fā)新體驗(yàn)
- Magento 2 Developer's Guide