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