Pip (Python): verschil tussen versies
Naar navigatie springen
Naar zoeken springen
(23 tussenliggende versies door dezelfde gebruiker niet weergegeven) | |||
Regel 1: | Regel 1: | ||
− | ''Pip'' is | + | ''Pip'' is de officiële Python ''package manager''. |
− | + | Dit artikel stamt uit 2018. Oude zooi (inclusief alles rondom Python2) heb ik in dec. 2020 verwijderd. Zie ''Geschiedenis weergeven'' als je dat toch nodig hebt. Dit artikel heeft uitsluitend betrekking op Python3. | |
− | |||
− | |||
− | |||
− | == | + | == Installatie == |
− | + | Dec. 2020, Linux Mint - Moeiteloos: | |
− | |||
− | |||
<pre> | <pre> | ||
sudo apt install python3-pip | sudo apt install python3-pip | ||
</pre> | </pre> | ||
− | |||
− | + | Testen: | |
+ | <pre> | ||
+ | > pip | ||
+ | bash: pip: command not found | ||
− | + | > pip3 | |
− | |||
Usage: | Usage: | ||
− | + | pip3 <command> [options] | |
+ | ... | ||
+ | </pre> | ||
+ | |||
+ | == Installatie van packages == | ||
− | + | Bv.: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | <pre> | |
− | + | pip3 install pymysql | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | == | + | == Locatie van packages == |
− | + | Je kunt de locatie via de command line achterhalen. Bv.: | |
<pre> | <pre> | ||
− | + | > pip3 show PyMysql | |
− | + | ||
+ | Name: PyMySQL | ||
+ | Version: 0.10.1 | ||
+ | Summary: Pure Python MySQL Driver | ||
+ | Home-page: https://github.com/PyMySQL/PyMySQL/ | ||
+ | Author: yutaka.matsubara | ||
+ | Author-email: yutaka.matsubara@gmail.com | ||
+ | License: "MIT" | ||
+ | Location: /home/jeroen/.local/lib/python3.8/site-packages | ||
+ | Requires: | ||
+ | Required-by: | ||
+ | </pre> | ||
+ | |||
+ | Ongetwijfeld kun je packages ook op account-onafhankelijke locaties installeren (bv. op een webserver), maar die kennis heb ik nu niet paraat. | ||
+ | |||
+ | == Environments == | ||
+ | |||
+ | [http://jakevdp.github.io/blog/2016/08/25/conda-myths-and-misconceptions/]: | ||
+ | |||
+ | :virtualenv/venv are utilites that allow users to create isolated Python environments that work with pip. | ||
− | + | == Bronnen == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | * http://jakevdp.github.io/blog/2016/08/25/conda-myths-and-misconceptions/ | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Huidige versie van 16 dec 2020 om 14:02
Pip is de officiële Python package manager.
Dit artikel stamt uit 2018. Oude zooi (inclusief alles rondom Python2) heb ik in dec. 2020 verwijderd. Zie Geschiedenis weergeven als je dat toch nodig hebt. Dit artikel heeft uitsluitend betrekking op Python3.
Installatie
Dec. 2020, Linux Mint - Moeiteloos:
sudo apt install python3-pip
Testen:
> pip bash: pip: command not found > pip3 Usage: pip3 <command> [options] ...
Installatie van packages
Bv.:
pip3 install pymysql
Locatie van packages
Je kunt de locatie via de command line achterhalen. Bv.:
> pip3 show PyMysql Name: PyMySQL Version: 0.10.1 Summary: Pure Python MySQL Driver Home-page: https://github.com/PyMySQL/PyMySQL/ Author: yutaka.matsubara Author-email: yutaka.matsubara@gmail.com License: "MIT" Location: /home/jeroen/.local/lib/python3.8/site-packages Requires: Required-by:
Ongetwijfeld kun je packages ook op account-onafhankelijke locaties installeren (bv. op een webserver), maar die kennis heb ik nu niet paraat.
Environments
[1]:
- virtualenv/venv are utilites that allow users to create isolated Python environments that work with pip.