How to install Python packages on Win7

Source: Internet
Author: User

Recently in Win7 Python, and then wrote some of the code involved in the reading and writing of Excel. So you need to use the package xlrd XLWT xlutils. The problem is that these packages are not found after import. Error prompt: Importerror:no module named xxxx

So go online to find tutorials that need to download the package and install it on Win7 python.

My Python installation path is: D:\Program Files (x86) \python27\

Install the tutorials on the web to search for Python-corresponding packages. Wle and. tar.gz. It was a surprise at the time, first of all. Wle, I haven't seen this kind of file for 30 years, and I've been checking it out on the internet, and I've given up a lot of trouble with the Wle file. Second, Tar.gz is not the Linux above the compression package, I want to Win7 on the installation ah eldest brother ... hesitated, or the. tar.gz downloaded to the computer, and then found to be able to decompress ..... It seems that the. tar.gz on Linux can be used on the Win7. Just don't know if Win7 's compression pack can be unpacked on Linux.

I unzipped the downloaded XLWT to the Python installation directory and then installed a tutorial steup.py install

The practice is:

CMD--->d:--->cd program Files (x86) \python27\xlwt-1.0.0---->setup.py Install but it's irritating to run Python steps with no effect, You are still prompted not to import the package. (I have to follow the tutorial, why not ah why ah ...)

And then, looking for another post on the internet, said to be Python setup.py install: cmd--->d:--->cd program Files (x86) \python27\xlwt-1.0.0----> Python setup.py Install

The result is tragic and depressing. I went to the internet and asked about the environment variables for the computer to be configured for Python. Looks very troublesome appearance ah, decisive gave up ...

Then, go to QQ group to ask how to do. It is suggested that the PIP command be used. Then very depressed, what ah, I this is Windows Ah windows.pip command how to run under cmd ah. Then the great God pointed out the following actions

CMD--->d:--->cd program Files (x86) \python27\scripts then executes pip install XLWT in the cmd window. And then waited for a moment to succeed. Also do not have to download files on the Internet or anything, do not configure what environment variables or something.   For a lazy man like me, it's a real convenience.  Later you decide to install the Python package under windows in this way! (Ps. Of course, this way must be connected to the Internet only.) Otherwise, oh, according to the above I did not succeed in the way I figured out to do it.

How to install Python packages on Win7

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.