boulderj
boulderj

Reputation: 11

No Module Named xlutils.copy and pip install fail

I am getting an error message that says "no module named xlutils.copy". When I got to do the pip install of xlutils.copy I get an error message "could not find a version that satifies the requirement". I downloaded xlutils 2.0.0 which contains xlutils.copy but I am not sure if it needs to be put in a certain directory?

from xlrd import open_workbook
from xlutils.copy import copy
rb = open_workbook('Excel FDT Master_01_update.xlsx')
wb = copy(rb)
s = rb.sheet_by_name('INPUT')
r = 5
for test in col_test:
    s.cell(rowx = r, colx = 1).value = test
    r += 1
wb.save('comeonenow.xls')

Upvotes: 0

Views: 2813

Answers (1)

GaryMBloom
GaryMBloom

Reputation: 5682

Perhaps you have multiple installations of Python, and the pip installed the xlutils in a different installation. If you try just:

import xlutils

I expect you'll get the same results as before. I feel this may be getting overlooked by some of the other posters. Your error message says it can't find the xlutils module, not some submodule or variable. Is this still the case?

When you have multiple installations of Python, only one is the "default", so to speak, and any module installations will install into that default Python installation. I am careful to only run two installations: Python 2.7 and 3.6. And I go into each installation and make sure that I have a pip2 and a python2, and a pip3 and python3, so that I can just reference directly to the Py version I want to use, either to run or to install new packages. Otherwise, if I just run pip, I'm not 1000% sure where it will go. (Okay, I'm exaggerating. I know Python 2 is my default. Just trying to make a point.) :)

Also, just because you think you only have one Python installation, that may not be the case. On Windows, yes. But on Mac, there is a preloaded Python installation, and updating the Python and getting new packages into the new version instead of the preloaded version can be tricky, depending on what you've done. Also, when you install an IDE like PyCharm, it wants to install a Python version, as well.

Last comment -- Sometimes (not usually but sometimes), an installed package will have a different name than you would think. That is not the case with xlutils. But, with fonttools, you install fonttools but you must import fontTools (note the capital 'T') into your Py script. Again, not the case with xlutils, but just be aware of this for the future.

Upvotes: 1

Related Questions