[PYTHON] Determine if the library is installed.

that? Was this already installed in the execution environment? In that case Well, if you think you only need to pip once and run it, it can be very heavy. The following is an example, and if you try to install Janome many times (perhaps not too often), it will be very heavy. Certainly something in mecab.

The code I made to make it work as a shortcut if it is already installed at that time. I confirmed that it works with colaboratory, but it is unconfirmed whether it works with ordinary jupyter notebook / Lab.

installed=!pip list
if "Janome" in "|".join(installed):
    pass
else:
   !pip install janome==0.3.6

Recommended Posts

Determine if the library is installed.
Determine if an attribute is defined in the object
Determine if AWS Chalice is chalice local
What is "mahjong" in the Python library? ??
[Python] Determine if any coordinate point is inside or outside the polygon
Dispersion with Python's standard library and Pillow Find the RGB standard deviation of the image and determine if it is monochromatic
Check if the string is a number in python
[Nohup] Execution even if the terminal is turned off
I installed and used the Deep Learning library Chainer
Check if it is Unix in the scripting language
Check if it is Unix in the scripting language
Solution if the module is installed in Python but you get an error in Jupyter notebook
I want to initialize if the value is empty (python)
Determine if a string is a time with a python regular expression
I installed the automatic machine learning library auto-sklearn on centos7
[Pandas] If the first row data is in the header in DataFrame
Automatically fetch the installed version
What is the activation function?
What is the Linux kernel?
What is the interface for ...
[Python] Check the installed libraries
What is the Callback function?
The image is a slug
What to do if the user name is changed and the pyenv library path does not pass
Python will fail if there is a space after the backslash
[Blender] Script to check if the selected one is a mesh
python Note: Determine if command line arguments are in the list
What to do if the inode is exhausted on EC2 Linux
Determine if all list elements are present in the dict key
Determine if standard output is piped when running a Python script
[Golang] Check if a specific character string is included in the character string
If the accuracy of the PCR test is poor, why not repeat the test?