Tuesday, 28 January 2020

Python module management - View and Copy Configuration.

help('modules')

Its a python command and provide an entire list of the python modules, which are installed in the system.

>>>python
>>>help('modules')

Result::: Please wait a moment while I gather a list of all available modules
abc                 fractions           pyexpat             webencodings
aifc                ftplib              pygments            werkzeug
alembic             functools           pygtkcompat         wheel
aniso8601           future_builtins     pymysql             whichdb
antigravity         gc                  pyparsing           wsgiref
...
...


pip list 

This command will provide the list of all the python module installed in the system, with the versions.



Result::: 
SQLAlchemy (1.3.13)
typing (3.7.4.1)
urllib3 (1.25.8)
visitor (0.1.3)
...


> pip freeze

 This command also provide you same list in different format.
Result::: 
visitor==0.1.3
webencodings==0.5.1
Werkzeug==0.16.1
wtf==0.1
WTForm==1.0
...

Install all module to a different machine


Now if you want to install all these modules to some other system, then you can use some python commands, if you are not using any configuration management tools like chef.

Then by using any of the command get the list, add then to a file and add pip install to each line and create a complete shell file like this.

pip install     visitor                 ;
pip install     webencodings            ;
pip install     Werkzeug                ;
pip install     wtf                     ;
pip install     WTForm                  ;
pip install     WTForms                 ;

Now just login to machine and run this file.

>> installtion.sh

All your module will be installed now to this machine.








No comments:

Post a Comment

Feature Selection in AI

In artifical intelegance/machine learning, everything start and end with data and in current world everyday by using facebook, insta we all ...