download :IPy Module download address
The official website provides the download of the source package , Source package in windows China and Linux You can use
1、 install
pip3 install IPy# install
#pip install IPy== edition
# Specify the version when installing , The default is the latest version
1、 download
2、 download , Source download
With pycharm Use for example
1、 Unzip the downloaded source code and enter it into the directory
2、 Move to pycharm Of the project path in venv\Lib\site-packages in , It can also be placed directly on the project , But generally not so square
Move to the path under the relevant project
3、 Use
import IPy
l1=IPy.IP('192.168.1.0/24').version()
# obtain ip The type of address ,ipv4 and ipv6 type
print(l1)#4
4、 uninstall
take IPy.py Just delete the file
Method 1 : Use it directly IPy file
In the source code IPy Copy the file to the path of the corresponding module
1、 Upload the downloaded source package to Linux On the device
[[email protected] ~]# ls IPy-1.01.tar.gz
IPy-1.01.tar.gz
2、 decompression
[[email protected] ~]# tar -zxvf IPy-1.01.tar.gz
# decompression
[[email protected] ~]# cd IPy-1.01/
# Enter the decompression path
3、 Copy IPy.py file
[[email protected] IPy-1.01]# cp IPy.py /usr/local/lib/python3.6/site-packages
4、 Use
[[email protected]liyu IPy-1.01]# python3
Python 3.6.8 (default, Oct 13 2020, 16:18:22)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import IPy
>>> IPy.IP('192.168.1.0/24').version()
4
5、 uninstall
Delete the copied IPy Just file
Method 2: Traditional installation
1、 Upload the downloaded source package to Linux On the device
[[email protected] ~]# ls IPy-1.01.tar.gz
IPy-1.01.tar.gz
2、 decompression
[[email protected] ~]# tar -zxvf IPy-1.01.tar.gz
# decompression
[[email protected] ~]# cd IPy-1.01/
# Enter the decompression path
5、 Installation and path
[[email protected] IPy-1.01]# python3 setup.py install
# install ,Linux There is python2 and 3 edition , No default setting yes Python2 edition , Use 3 The version is python3, Can be python3 Set to python
The installation path will be displayed during installation
Installation results
[[email protected] site-packages]# pwd
/usr/local/lib/python3.6/site-packages
[[email protected] site-packages]# ls
IPy-1.01-py3.6.egg-info IPy.py __pycache__
6、 Use
[[email protected] ~]# python3
Python 3.6.8 (default, Oct 13 2020, 16:18:22)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import IPy
>>> IPy.IP('192.168.1.0/24').version()
4
7、 uninstall
Just delete the contents of the installation module path
[[email protected] site-packages]# ls
IPy-1.01-py3.6.egg-info IPy.py __pycache__