Unable to install using pip or python setup.py

1,936 views
Skip to first unread message

neil.j...@gmail.com

unread,
Mar 26, 2015, 10:09:00 AM3/26/15
to openpyx...@googlegroups.com
I think this may have something to do with my corporate firewall settings.
The first thing I tried was pip:
pip install openpyxl
Downloading/unpacking openpyxl
  Cannot fetch index base URL https://pypi.python.org/simple
  Could not find any downloads that satisfy the requirement openpyxl
Cleaning up...
No distributions at all found for openpyxl
Storing debug log for failure in C:\Users\name\pip\pip.log
That debug log looked like this:
  Downloading/unpacking openpyxl
  Getting page https://pypi.python.org/simple/openpyxl/
  Could not fetch URL https://pypi.python.org/simple/openpyxl/: timed out
  Will skip URL https://pypi.python.org/simple/openpyxl/ when looking for download links for openpyxl
  Getting page https://pypi.python.org/simple/
  Could not fetch URL https://pypi.python.org/simple/: timed out
  Will skip URL https://pypi.python.org/simple/ when looking for download links for openpyxl
  Cannot fetch index base URL https://pypi.python.org/simple/
  URLs to search for versions for openpyxl:
  * https://pypi.python.org/simple/openpyxl/
  Getting page https://pypi.python.org/simple/openpyxl/
  Could not fetch URL https://pypi.python.org/simple/openpyxl/: timed out
  Will skip URL https://pypi.python.org/simple/openpyxl/ when looking for download links for openpyxl
  Could not find any downloads that satisfy the requirement openpyxl
Cleaning up...
  Removing temporary dir c:\users\dqa8300\appdata\local\temp\pip_build_DQA8300...
No distributions at all found for openpyxl
Exception information:
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "C:\Python27\lib\site-packages\pip\commands\install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "C:\Python27\lib\site-packages\pip\req.py", line 1177, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "C:\Python27\lib\site-packages\pip\index.py", line 277, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req) 
DistributionNotFound: No distributions at all found for openpyxl


 So I went and downloaded the tar, extracted it and went to command line, navigated to the file and did python setup.py install which seemed to mostly work fine until this part:

Installed c:\python27\lib\site-packages\openpyxl-2.2.0-py2.7.egg
Processing dependencies for openpyxl==2.2.0
Searching for jdcal
Reading https://pypi.python.org/simple/jdcal/
Download error on https://pypi.python.org/simple/jdcal/: timed out -- Some packa
ges may not be found!
Couldn't find index page for 'jdcal' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: timed out -- Some packages ma
y not be found!
No local packages or download links found for jdcal
error: Could not find suitable distribution for Requirement.parse('jdcal')
 
Is there any version that doesn't have to access the web? Or is there a workaround of some sort?

Charlie Clark

unread,
Mar 26, 2015, 10:26:58 AM3/26/15
to openpyx...@googlegroups.com
Am .03.2015, 15:09 Uhr, schrieb <neil.j...@gmail.com>:

> Is there any version that doesn't have to access the web? Or is there a
> workaround of some sort?

We use an external library, jdcal, on the assumption that if openpyxl is
being installed from the web then it can be as well. So you'll need to
download the source for that as well. And I'd recommend getting lxml as
well if you're writing larger files.

If you look at the windows docs you'll find some hints on how to use pip
with a local download cache:
http://openpyxl.readthedocs.org/en/latest/windows-development.html

But if you're doing a lot of installs you might want to look at using
devpi as a local PyPI mirror.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
Message has been deleted

neil.j...@gmail.com

unread,
Mar 26, 2015, 11:55:13 AM3/26/15
to openpyx...@googlegroups.com
I installed jdcal - now I am getting different errors, for example I'm just trying to open this file and print one value from it:
from openpyxl import load_workbook
wb = load_workbook('myfile.xlsx');
sheet = wb['Details']
print(sheet['A9'].value)
print('Done.')

 which gives me this error:
Traceback (most recent call last):
  File "U:\Vendor Team\FTS\ExcelTest.py", line 16, in <module>
    wb = load_workbook('myfile.xlsx');
  File "C:\Python27\lib\site-packages\openpyxl-2.2.0-py2.7.egg\openpyxl\reader\excel.py", line 149, in load_workbook
    _load_workbook(wb, archive, filename, read_only, keep_vba)
  File "C:\Python27\lib\site-packages\openpyxl-2.2.0-py2.7.egg\openpyxl\reader\excel.py", line 237, in _load_workbook
    keep_vba=keep_vba)
  File "C:\Python27\lib\site-packages\openpyxl-2.2.0-py2.7.egg\openpyxl\reader\worksheet.py", line 324, in read_worksheet
    fast_parse(ws, xml_source, shared_strings, style_table, color_index)
  File "C:\Python27\lib\site-packages\openpyxl-2.2.0-py2.7.egg\openpyxl\reader\worksheet.py", line 312, in fast_parse
    parser.parse()
  File "C:\Python27\lib\site-packages\openpyxl-2.2.0-py2.7.egg\openpyxl\reader\worksheet.py", line 93, in parse
    dispatcher[tag_name](element)
  File "C:\Python27\lib\site-packages\openpyxl-2.2.0-py2.7.egg\openpyxl\reader\worksheet.py", line 189, in parse_row_dimensions
    self.parse_cell(cell)
  File "C:\Python27\lib\site-packages\openpyxl-2.2.0-py2.7.egg\openpyxl\reader\worksheet.py", line 134, in parse_cell
    cell = Cell(self.ws, column, row, **style)
TypeError: __init__() got an unexpected keyword argument 'pivotButton'
>>> 

It seems like maybe something went wrong in the install, but I'm not sure..

Charlie Clark

unread,
Mar 26, 2015, 11:58:00 AM3/26/15
to openpyx...@googlegroups.com
Am .03.2015, 16:55 Uhr, schrieb <neil.j...@gmail.com>:

> TypeError: __init__() got an unexpected keyword argument 'pivotButton'
>>
>> >>>
>>
>>
> It seems like maybe something went wrong in the install, but I'm not
> sure..

This means you've got pivot tables in your worksheets. They use a style
that's invisible in the UI that trips this bug. It's fixed in the 2.2
branch and will be in 2.2.1. In the meantime you either need a checkout,
which is likely to be difficult in your network if I understand things
correctly, or download 2.1.5 and install pip openpyxl==2.1.5

Sorry for the inconvenience.

neil.j...@gmail.com

unread,
Mar 26, 2015, 12:14:02 PM3/26/15
to openpyx...@googlegroups.com
I'm not working with the pivot tables at all, so that's unfortunate. You're saying 2.1.5 doesn't have this bug? I downloaded 2.1.5 and installed, then removed the 2.2 folder from my site-packages but now when I run my script I get:
Traceback (most recent call last):
  File "U:\Vendor Team\FTS\ExcelTest.py", line 15, in <module>
    from openpyxl import load_workbook
ImportError: No module named openpyxl

I see the 2.1.5 egg file in my site-packages so I'm a little confused.
Sorry for all the questions, I appreciate all your help. 

Charlie Clark

unread,
Mar 26, 2015, 12:44:14 PM3/26/15
to openpyx...@googlegroups.com
Am .03.2015, 17:14 Uhr, schrieb <neil.j...@gmail.com>:

> I'm not working with the pivot tables at all, so that's unfortunate.

It's the only reason the style would be used. From the spec:
"""
A boolean value indicating whether the cell rendering includes a pivot
table dropdown button.
"""

You'll get the same error with quotePrefix.

> You're
> saying 2.1.5 doesn't have this bug? I downloaded 2.1.5 and installed,
> then
> removed the 2.2 folder from my site-packages but now when I run my
> script I
> get:

2.1.5 won't have this bug (feature), no. 2.2 contains a lot of reworking
of the internal code and we did give it several weeks beta. But, as always
some bugs will only crop up with real code.

>> Traceback (most recent call last):
>>
>> File "U:\Vendor Team\FTS\ExcelTest.py", line 15, in <module>
>>
>> from openpyxl import load_workbook
>>
>> ImportError: No module named openpyxl
>>
>>
> I see the 2.1.5 egg file in my site-packages so I'm a little confused.
> Sorry for all the questions, I appreciate all your help.

pip uninstall openpyxl
pip install openpyxl==2.1.5

Assuming you've got you're environment configured to use your download
folder.

neil.j...@gmail.com

unread,
Mar 26, 2015, 2:40:47 PM3/26/15
to openpyx...@googlegroups.com
I'm sorry, I do have pivot tables in these files - but am not using them in this process is what I meant. I finally got it working. Thanks again for all your help Charlie!


On Thursday, March 26, 2015 at 10:58:00 AM UTC-5, Charlie Clark wrote:
Am .03.2015, 17:14 Uhr, schrieb 


I'm not working with the pivot tables at all, so that's unfortunate.

It's the only reason the style would be used. From the spec:
"""
A boolean value indicating whether the cell rendering includes a pivot table dropdown button.
"""

You'll get the same error with quotePrefix.

You're
saying 2.1.5 doesn't have this bug? I downloaded 2.1.5 and installed, then
removed the 2.2 folder from my site-packages but now when I run my script I
get:

2.1.5 won't have this bug (feature), no. 2.2 contains a lot of reworking of the internal code and we did give it several weeks beta. But, as always some bugs will only crop up with real code.
Traceback (most recent call last):

  File "U:\Vendor Team\FTS\ExcelTest.py", line 15, in <module>

    from openpyxl import load_workbook

ImportError: No module named openpyxl


I see the 2.1.5 egg file in my site-packages so I'm a little confused.
Sorry for all the questions, I appreciate all your help.

Charlie Clark

unread,
Mar 26, 2015, 2:41:58 PM3/26/15
to openpyx...@googlegroups.com
Am .03.2015, 19:40 Uhr, schrieb <neil.j...@gmail.com>:

> I'm sorry, I do have pivot tables in these files - but am not using them
> in
> this process is what I meant. I finally got it working. Thanks again for
> all your help Charlie!

That's good to hear.
Reply all
Reply to author
Forward
0 new messages