How to install python package on Windows 7 and python on Windows 7

Source: Internet
Author: User

How to install python package on Windows 7 and python on Windows 7

I recently started python on Windows 7 and wrote some code that involved reading and writing Excel. therefore, the package xlrd xlwt xlutils is required. but the problem is that these packages cannot be found after import. error message: ImportError: No module named xxxx

Therefore, go to the Internet to find a tutorial saying that you need to download the package and install it on python of win7.

My python installation path is: D: \ Program Files (x86) \ Python27 \

 

Install the online tutorial to search for the corresponding python package. I found that there are. wle and .tar.gz. At that time, I was surprised. First of all, what is wle ?, Ghost can be used on Windows 7. I don't know whether the zip package of Windows 7 can be decompressed on linux.

I decompress the downloaded xlwt to the python installation directory, and then install steup. py install for a tutorial.

The practice is:

Cmd ---> d: ---> cd Program Files (x86) \ Python27 \ xlwt-1.0.0 ----> setup. py install, but it is not very effective to run python, and it is still prompted that the import package is not allowed. (I did it through the tutorial. Why not? Why ....)

Then I found another post on the Internet saying that I want python setup. py install to almost: cmd ---> d: ---> cd Program Files (x86) \ Python27 \ xlwt-1.0.0 ----> python setup. py install

The tragedy of the result is that the result is depressing again. I went to the Internet and asked if I wanted to configure python environment variables for my computer. It looked very troublesome and gave up...

Then, I went to the QQ group and asked how to do it. someone suggested using the pip command .. at that time, it was quite depressing. What did you do? I am a windows or windows. how can I run the pip command in cmd .. then the gods gave pointers to the following actions:

Cmd ---> d: ---> cd Program Files (x86) \ Python27 \ Scripts and then execute pip install xlwt In the cmd window. then, wait for a moment until the operation succeeds. you do not need to download files or configure any environment variables .. it's really convenient for a lazy person like me .. later, I decided to use this method to install the python package under windows! (Ps. Of course, this method must be connected to the Internet. Otherwise, I will figure it out based on the method I did not succeed)

 

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.