csvkit: csvstat gives me "'NoneType' object has no attribute 'decimal_formats'" error for tutorial data
Whenever I try csvstat for the tutorial data, I get the following error and it just stops wherever it detects the error
$ csvstat data.csv
1. "state"
Type of data: Text
Contains null values: False
Unique values: 1
Most common values: NE (1036x)
2. "county"
Type of data: Text
Contains null values: False
Unique values: 35
Most common values: DOUGLAS (760x)
DAKOTA (42x)
CASS (37x)
HALL (23x)
LANCASTER (18x)
3. "fips"
Type of data: Number
Contains null values: False
Unique values: 35
'NoneType' object has no attribute 'decimal_formats'
Most common values:
My environment:
OS X 10.11.6
python version : 2.7.10
pip version : 9.0.1
I installed csvkit via pip yesterday (Apr 8th)
Any idea?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 27 (11 by maintainers)
Commits related to this issue
- Closes #821 using solution from wireservice/agate#488 — committed to wireservice/csvkit by deleted user 7 years ago
- Merge pull request #823 from wireservice/821 Closes #821 using solution from wireservice/agate#488 — committed to wireservice/csvkit by deleted user 7 years ago
- Add locale parameter to all format_decimal calls, #821 — committed to wireservice/csvkit by deleted user 7 years ago
- Merge pull request #878 from wireservice/formatdecimal Add locale parameter to all format_decimal calls, #821 — committed to wireservice/csvkit by jpmckinney 7 years ago
Sweet! I can confirm that 1.0.3 solves this issue, at least on my side:
sudo pip install --ignore-installed git+https://github.com/wireservice/csvkit.git@master
If anyone else is having the same issue with 1.0.2 and running macOS using system’s Python, it is worth noting that only using
pip install --ignore-installed git+https://github.com/wireservice/csvkit.git@master
will install csvkit, but not solve the issue - probably becausepip install
in this case won’t have access to the Python library.@jpmckinney Thank you for fixing this issue!
On macOS I would recommend not using the system’s Python, and instead use Python installed by Homebrew. The system Python causes many problems.
I personally do:
@bekicot FYI: The suggested work-around does not return all expected output values:
Specifically,
csvstat input --csv
does not return mean, max, sum, mean, median, stdev, len.