程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

IPY module installation of Python

編輯:Python

IPy install

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、windows Use installation in the system

1、 install

pip3 install IPy# install 
#pip install IPy== edition 
# Specify the version when installing , The default is the latest version 

2、 Download the source code in windows Medium or Linux You can use

1、 download

2、 download , Source download

1、windows Use in

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

2、 stay Linux Use in

1、 Method 1

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

2、 Method 2

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__

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved