How to install the Python WHL library offline

Source: Internet
Author: User

For people working in the corporate intranet environment, it may not be possible to install the Python WHL library using the PIP Install command. In this case, we can install a WHL library in the following way.

1 Download the WHL file, note that the version of the WHL file is consistent with the local Python version, as follows: Https://pypi.python.org/pypi/wxPython

2 with WinRAR or zip and other decompression software open, WHL is actually a compression of the file;

3 The extracted files are copied to the Python lib directory (the environment variable is configured, it can also be placed in the environment variable path);

4 test: Import XXX, see if the error, no error can be normal use.

For example: I am now going to install the Wxpython Library on Windows 64Bit OS, the offline installation steps are as follows:

1) Find native Python version: 2.7+32 bit, check if there are WX packages

2) Download Python-specific version: WXPYTHON-4.0.1-CP27-CP27M-WIN32.WHL (MD5, PGP)

3) Unzip it with WinRAR and copy it to the Python lib directory:

Only the WX catalog files can also be

4) Check if the installation is successful

As we can see, the second time using the WX library is no longer an error. OK, the installation is successful, we can use the package to do some simple development:

1 ImportWX2  3App =WX. APP ()4window = WX. Frame (None, title ="This was Test for WxPython", size = (400,400)) 5Panel =WX. Panel (window)6label = WX. Statictext (panel, label ="Hello World", pos = (150,150)) 7 window. Show (True)8App. Mainloop ()

The effect is as follows:

How to install the Python WHL library offline

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.