Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash check if python package is installed

# Basic syntax:
pip list | grep packagename # or:
pip3 list | grep packagename
# Where:
#	- pip/pip3 list lists all installed Python packages (in the current env)
#	- grep packagename searches for the packagename in the list of packages
#		installes with pip/pip3

# Example usage:
pip list | grep numpy
numpy                              1.20.3
numpydoc                           1.1.0
Comment

bash check if python package is installed

$ python2 -m doesnt_exist |& grep -q 'No module named' && echo 'Nope' || echo 'Yup'
Nope

$ python2 -m math |& grep -q 'No module named' && echo 'Nope' || echo 'Yup'
Yup
Comment

PREVIOUS NEXT
Code Example
Shell :: vim how to append to every line 
Shell :: git clone different name 
Shell :: kubectl cleanup pods 
Shell :: see file size linux 
Shell :: linux move folder and subfolders to parent 
Shell :: find a file in linux terminal 
Shell :: Failed at the sharp@0.16.2 install script 
Shell :: libnss3.so: cannot open shared object file: No such file or directory 
Shell :: linux make user like root 
Shell :: snap install package 
Shell :: powershell get all file extensions in directory 
Shell :: drush config import single file 
Shell :: curl ssl verify false cli 
Shell :: disable password ssh login 
Shell :: search by commit message 
Shell :: restart wsl 
Shell :: webmin restart 
Shell :: conda install notebook 
Shell :: windows vpn service 
Shell :: git pull from another branch 
Shell :: ubuntu start pycharm 
Shell :: linux && 
Shell :: add arabic keyboard ubuntu 20.04 
Shell :: How to use the sort command 
Shell :: sequelize installation 
Shell :: committed to wrong branch 
Shell :: how to install httrack in kali linux 
Shell :: install grafana 
Shell :: ngrok install authtoken 
Shell :: install fish ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =