|
POST
|
I searched the forum for this same problem that lhlibrary has, and hit this thread. I'm just trying out some of the new features that ArcExplorer has. I added a shapefile with 755 records, 12 fields, and it displays fine. Then I thought maybe I could symbolize based on the unique values in one field, but all I get is a spinning graphic. Shapefile too big?
... View more
07-30-2013
04:00 PM
|
0
|
0
|
947
|
|
POST
|
I got openpyxl to work with Excel 2013 files. from openpyxl import load_workbook
wb = load_workbook(filename = r'Excel2013.xlsx')
sheet_ranges = wb.get_sheet_by_name(name = 'Sheet1')
print sheet_ranges.cell('C3').value # C3 returns, prints the value in cell C3. However, I can't get openpyxl to work with Excel 2003 xls files. wb = load_workbook(filename = r'Excel2003.xls') blows up. I thought openpyxl was supposed to work with both. No it says right there at the top of the library web page "A Python library to read/write Excel 2007 xlsx/xlsm " I'm still waiting for a upgrade from Microsoft that fixes more problems than it causes. Here's a Google group that supports openpyxl for those of you that are interested in trying it: http://https://groups.google.com/forum/#!forum/openpyxl-users
... View more
07-26-2013
02:02 PM
|
0
|
0
|
1686
|
|
POST
|
ez_setup.py would not install setuptools-0.9.8 for me either. I didn't spot anything in the script that sensed my OS and downloaded the 64 bit version. But I downloaded setuptools.-0.9.8.tar.gz from https://pypi.python.org/packages/source/s/setuptools, unpacked it myself, opened cmd and changed directory to the unpacked folder, ran "python setup.py install" and everything installed without a problem.
... View more
07-26-2013
01:14 PM
|
0
|
0
|
870
|
|
POST
|
I don't know why ez_setup.py would install setuptools-0.9.7 for me, but I downloaded setuptools.-0.9.8.tar.gz from https://pypi.python.org/packages/source/s/setuptools, unpacked it myself, opened cmd and changed directory to the unpacked folder, ran "python setup.py install" and everything installed without a problem. Then I used cmd, changed directory to the unpacked openpyxl folder, ran "python setup.py install" and it looked like openpyxl installed without problems. Now back to testing openpyxl on Excel 2013 files.
... View more
07-26-2013
01:13 PM
|
0
|
0
|
1686
|
|
POST
|
You mean IDLE, running under my administrator account, isn't running with admin rights?
... View more
07-26-2013
12:44 PM
|
0
|
0
|
870
|
|
POST
|
I'm stumped by my inability to install setuptools 0.9.7 on Windows 7,64, python 2.7.2. On running ez_setup.py I got the error: Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz Extracting in c:\users\paul\appdata\local\temp\tmptm3fqf Now working in c:\users\paul\appdata\local\temp\tmptm3fqf\setuptools-0.9.7 Installing Setuptools Something went wrong during the installation. See the error message above. Traceback (most recent call last): File "C:\Users\Paul\Documents\pyscripts\ez_setup.py", line 264, in <module> sys.exit(main()) SystemExit: 2 Because python is installed down in c:\python27\arcgis10.1, I thought I'd try adding an environmental variable %PYTHON_PATH% and append it to %PATH%, but I got the same messages as above. But at least I can start python from any folder now. Could it be that the python that ArcGIS installs is 32 bit, but the version of setuptools I downloaded is 64 bit, that somehow the download site sensed my OS?
... View more
07-26-2013
10:14 AM
|
0
|
4
|
1667
|
|
POST
|
Today I thought I'd try adding an environmental variable %PYTHON_PATH% and append it to %PATH%, but I got the same messages from both of the steps above.
... View more
07-25-2013
10:36 AM
|
0
|
0
|
3874
|
|
POST
|
It doesn't look promising. The openpyxl webpage http://openpyxl.readthedocs.org/en/latest/#getting-the-source mentions only Excel 2007 xlsx files. Plus I'm having difficulty installing openpyxl in Windows and Python 2.7. With cmd python setup.py install, I got "No Module named setuptools" (see attached image) [ATTACH=CONFIG]26177[/ATTACH] Then I tried to install setuptools 0.9.7 https://pypi.python.org/pypi/setuptools/0.9.7#windows but on running ez_setup.py I got another error: Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz
Extracting in c:\users\paul\appdata\local\temp\tmptm3fqf
Now working in c:\users\paul\appdata\local\temp\tmptm3fqf\setuptools-0.9.7
Installing Setuptools
Something went wrong during the installation.
See the error message above.
Traceback (most recent call last):
File "C:\Users\Paul\Documents\pyscripts\ez_setup.py", line 264, in <module>
sys.exit(main())
SystemExit: 2
... View more
07-24-2013
09:22 AM
|
0
|
0
|
3875
|
|
POST
|
People at SO say that xlrd currently works with the .xlsx extension, http://stackoverflow.com/questions/4371163/reading-xlsx-files-using-python but that may not include the Excel 2013 files. But there is openpyxl https://bitbucket.org/ericgazoni/openpyxl/ that I will try tomorrow.
... View more
07-23-2013
04:28 PM
|
0
|
0
|
3875
|
|
POST
|
There's another simple example at http://codingtutorials.co.uk/python-excel-xlrd-xlwt/ If I run it on xls files the print.sheet_value doesn't seem to print anything. Wait, yes it works, I just happened to hit an empty cell. But when I try to read a xlsx file, it really blows up. There's a example on this site to create a workbook, and that runs, creates a xls file with a bunch of numbers in it.
... View more
07-23-2013
03:47 PM
|
0
|
0
|
3875
|
|
POST
|
Double check your xlrd version and test on a simple xlsx file. I'm using xlrd 0.9.2. Is there revision beyond that?
... View more
07-23-2013
03:29 PM
|
0
|
0
|
3875
|
|
POST
|
When I tried the simple file opening routine on page 7 it seemed d to work with xls files: from mmap import mmap,ACCESS_READ
from xlrd import open_workbook
print open_workbook('simple.xls')
with open('simple.xls','rb') as f:
print open_workbook(
file_contents=mmap(f.fileno(),0,access=ACCESS_READ)
)
aString = open('simple.xls','rb').read()
print open_workbook(file_contents=aString) >>> <xlrd.Book object at 0x02950390> <xlrd.Book object at 0x029211D0> <xlrd.Book object at 0x029C19B0> >>> But seemed to blow up when I tried a xlsx file: Traceback (most recent call last): File "C:\Users\Paul\Documents\pyscripts\Office\open.py", line 3, in <module> print open_workbook('simple.xlsx') File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\__init__.py", line 429, in open_workbook biff_version = bk.getbof(XL_WORKBOOK_GLOBALS) File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\__init__.py", line 1545, in getbof bof_error('Expected BOF record; found %r' % self.mem[savpos:savpos+8]) File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\__init__.py", line 1539, in bof_error raise XLRDError('Unsupported format, or corrupt file: ' + msg) XLRDError: Unsupported format, or corrupt file: Expected BOF record; found 'PK\x03\x04\x14\x00\x06\x00'
... View more
07-23-2013
02:33 PM
|
0
|
0
|
3875
|
|
POST
|
I'm using Python 2.7.2. When I try the simple example on page 10 with an xlsx file in the same folder as the script, I get a lot of red returned: from xlrd import open_workbook,XL_CELL_TEXT
book = open_workbook('simple.xlsx')
sheet = book.sheet_by_index(1)
cell = sheet.cell(0,0)
print cell
print cell.value
print cell.ctype==XL_CELL_TEXT
for i in range(sheet.ncols):
print sheet.cell_type(1,i),sheet.cell_value(1,i) Traceback (most recent call last): File "C:\Users\Paul\Documents\pyscripts\Office\cell_access.py", line 2, in <module> book = open_workbook('simple.xlsx') File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\__init__.py", line 429, in open_workbook biff_version = bk.getbof(XL_WORKBOOK_GLOBALS) File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\__init__.py", line 1545, in getbof bof_error('Expected BOF record; found %r' % self.mem[savpos:savpos+8]) File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\__init__.py", line 1539, in bof_error raise XLRDError('Unsupported format, or corrupt file: ' + msg) XLRDError: Unsupported format, or corrupt file: Expected BOF record; found 'PK\x03\x04\x14\x00\x06\x00' If I try the script on an xls file, I get a lot less red. But I thought this worked for we on xls files last week. Traceback (most recent call last): File "C:\Users\Paul\Documents\pyscripts\Office\cell_access.py", line 4, in <module> cell = sheet.cell(0,0) File "C:\Python27\ArcGIS10.1\lib\site-packages\xlrd\sheet.py", line 255, in cell self._cell_types[rowx][colx], IndexError: list index out of range
... View more
07-23-2013
02:18 PM
|
0
|
0
|
3875
|
|
POST
|
I'm interested in trying some data manipulation and retrieval from Excel spreadsheets. I've been trying out the xlrd, xlwt, and xlutils packages from http://www.python-excel.org/ with some success, but it seems I can't make these packages work with .xlsx files, unless I go to Excel and save them as Excel 97-03 formats, .xls. Are there updates to these packages for Excel 2013?
... View more
07-18-2013
10:09 AM
|
0
|
18
|
21199
|
|
POST
|
Why do you suppose I'm getting this Web Browser message on most tools since last week when I try to fill in an argument: "An ActiveX control on this page is not safe. Your current security settings prohibit running unsafe controls on this page. As a result, this page might not display as intended." ? It seems to pop up on the first thing I click on in a tool. Then I close the error message and I'm able to continue. I don't normally use Internet Explorer, but I tried changing the IE security settings to medium. http://forums.arcgis.com/threads/10446-arccatalog-v10-internet-explorer-script-error-on-page-run-activex-control I don't see a script error message so I don't think these work arounds would be helpful: http://support.esri.com/en/knowledgebase/techarticles/detail/38099 http://support.esri.com/en/knowledgebase/techarticles/detail/33792 I'm running ArcGIS Desktop 10.1, SP1, Windows 7, 64 bit.
... View more
04-29-2013
01:11 PM
|
0
|
3
|
3514
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-28-2018 04:57 PM | |
| 3 | 09-20-2017 02:37 PM | |
| 1 | 09-20-2017 02:21 PM | |
| 1 | 03-09-2018 03:25 PM | |
| 1 | 03-12-2015 02:06 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|