Installing xlwt module on python 2.7 [windows - 64 bit]

15,498

First Download and Extract xlwt folder into python/any Directory

If You made chdir to Xlwt folder,Then python will look only into that folder, so to view the xlwt directory from python homedirectory just add these two lines to your program at beginning.

  1. import sys
  2. sys.path.insert(0,new_path) where new_path is the path of xlwt folder

Now you can use import xlwt which will work fine.

import sys

sys.path.insert(0,'C:/Python27/xlwt-0.7.5')
Share:
15,498
Napalkov Andrey
Author by

Napalkov Andrey

Updated on June 04, 2022

Comments

  • Napalkov Andrey
    Napalkov Andrey almost 2 years

    I have win 7 64-bit, and python 2.6, 2.7, 3.3 installed. When I download and extract xlwt 0.7.4 (https://pypi.python.org/pypi/xlwt), the readme asks for: .zip file into a suitable directory, chdir to that directory, then do "python setup.py install".

    Is chdir necessary? How do you do this? When I run setup.py, the black command prompt appears, and nothing happens. No matter what, I still get ImportError: No module named 'xlwt' on import attempt.

    Can anyone write a quick nooby step by step guide to install this useful module (Windows 7 - 8 bit)? Thanks in advance for the help.

  • user65165
    user65165 almost 9 years
    i seem to only be able to download xlwt as a .tar.gz not a zip file
  • Lakshmi Narayanan
    Lakshmi Narayanan over 8 years
    It is still giving me the error. I did not extract it to a python folder, but outside in another drive. I hope that doesn't affect the functionality of insert.
  • Nagendra Babu
    Nagendra Babu about 8 years
    @LakshmiNarayanan : There won't be any effect on insert functionality though you keep your package folder at other location.... The insert function will be searching for the location we provided and will add that to python sys path. The Otherway around is, you can try using append function instead of insert which accepts only one argument that is path of the Package folder.