Giter Site home page Giter Site logo

urschrei / convertbng Goto Github PK

View Code? Open in Web Editor NEW
37.0 4.0 7.0 110.26 MB

Fast, accurate WGS84 ⬅️➡️ OSGB36 (OSTN15) conversion, using Python and Rust

Home Page: https://pypi.python.org/pypi/convertbng

License: MIT License

Python 76.80% C 0.28% Cython 22.92%
geo geospatial bng ostn15 osgb36 ostn02 rust

convertbng's Introduction

CI Status Coverage Status PyPI Version MIT licensed DownloadsDOI

Description

A utility library for converting decimal WGS84 longitude and latitude coordinates into ETRS89 (EPSG:25830) and/or British National Grid (More correctly: OSGB36, or EPSG:27700) Eastings and Northings, and vice versa.

Conversion is handled by a Rust binary using FFI, and is quite fast. Some benchmarks can be found here.

Installation

pip install convertbng
Please use an up-to-date version of pip (8.1.2 as of June 2016)

Supported Platforms

The package has been built for and tested on the following platforms:

  • Linux x86_64 and aarch64 Python 3.{7, 8, 9, 10, 11, 12} (Manylinux2014)
  • macOS x86_64 and arm64 Python 3.{7, 8, 9, 10, 11, 12}
  • Windows 64-bit Python 3.{7, 8, 9, 10, 11, 12}

Windows Binaries

The Rust DLL and the Cython extension used by this package have been built with an MSVC toolchain. You shouldn't need to install any additional runtimes in order for the wheel to work, but please open an issue if you encounter any errors.

Usage

The functions accept either a sequence (such as a list or numpy array) of longitude or easting values and a sequence of latitude or northing values, or a single longitude/easting value and single latitude/northing value. Note the return type:
"returns a list of two lists containing floats, respectively"

NOTE: Coordinate pairs outside the BNG bounding box, or without OSTN15 coverage will return a result of
[[nan], [nan]], which cannot be mapped. Since transformed coordinates are guaranteed to be returned in the same order as the input, it is trivial to check for this value. Alternatively, ensure your data fall within the bounding box before transforming them:

Longitude:
East: 1.7800
West: -7.5600
Latitude:
North: 60.8400
South: 49.9600

All functions try to be liberal about what containers they accept: list, tuple, array.array, numpy.ndarray, and pretty much anything that has the __iter__ attribute should work, including generators.

from convertbng.util import convert_bng, convert_lonlat

# convert a single value
res = convert_bng(lon, lat)

# convert longitude and latitude to OSGB36 Eastings and Northings using OSTN15 corrections
lons = [lon1, lon2, lon3]
lats = [lat1, lat2, lat3]
res_list = convert_bng(lons, lats)

# convert lists of BNG Eastings and Northings to longitude, latitude
eastings = [easting1, easting2, easting3]
northings = [northing1, northing2, northing3]
res_list_en = convert_lonlat(eastings, northings)

# assumes numpy imported as np
lons_np = np.array(lons)
lats_np = np.array(lats)
    res_list_np = convert_bng(lons_np, lats_np)

Cython Module

If you're comfortable with restricting yourself to NumPy f64 arrays, you may use the Cython functions instead. These are identical to those listed below, but performance on large datasets is better. They are selected by changing the import statement
from convertbng.util import to
from convertbng.cutil import

The conversion functions will accept most sequences which implement __iter__, as above (list, tuple, float, array.array, numpy.ndarray), but will always return NumPy f64 ndarray. In addition, you must ensure that your inputs are float, f64, or d in the case of array.array.

But I Have a List of Coordinate Pairs

coords = [[1.0, 2.0], [3.0, 4.0]]
a, b = list(zip(*coords))
# a is (1.0, 3.0)
# b is (2.0, 4.0)

But I have Shapely Geometries

from convertbng.util import convert_etrs89_to_ll
from shapely.geometry import LineString
from shapely.ops import transform
from math import isnan
from functools import partial

def transform_protect_nan(f, xs, ys):
    # This function protects Shapely against NaN values in the output of the
    # transform, which would otherwise case a segfault.
    xs_t, ys_t = f(xs, ys)
    assert not any([isnan(x) for x in xs_t]), "Transformed xs contains NaNs"
    assert not any([isnan(y) for y in ys_t]), "Transformed ys contains NaNs"
    return xs_t, ys_t

convert_etrs89_to_lonlat_protect_nan = partial(transform_protect_nan, convert_etrs89_to_ll)

line = LineString([[651307.003, 313255.686], [651307.004, 313255.687]])

new_line = transform(convert_etrs89_to_lonlat_protect_nan, line)

Available Conversions (AKA I Want To…)

  • transform longitudes and latitudes to OSGB36 Eastings and Northings very accurately:
    • use convert_bng()
  • transform OSGB36 Eastings and Northings to longitude and latitude, very accurately:
    • use convert_lonlat()
  • transform longitudes and latitudes to ETRS89 Eastings and Northings, very quickly (without OSTN15 corrections):
    • use convert_to_etrs89()
  • transform ETRS89 Eastings and Northings to ETRS89 longitude and latitude, very quickly (the transformation does not use OSTN15):
    • use convert_etrs89_to_lonlat()
  • convert ETRS89 Eastings and Northings to their most accurate real-world representation, using the OSTN15 corrections:
    • use convert_etrs89_to_osgb36()

Provided for completeness:

  • transform accurate OSGB36 Eastings and Northings to less-accurate ETRS89 Eastings and Northings:
    • use convert_osgb36_to_etrs89()

Relationship between ETRS89 and WGS84

From Transformations and OSGM02™ User guide, p7. Emphasis mine.

[…] ETRS89 is a precise version of the better known WGS84 reference system optimised for use in Europe; however, for most purposes it can be considered equivalent to WGS84. Specifically, the motion of the European continental plate is not apparent in ETRS89, which allows a fixed relationship to be established between this system and Ordnance Survey mapping coordinate systems. Additional precise versions of WGS84 are currently in use, notably ITRS; these are not equivalent to ETRS89. The difference between ITRS and ETRS89 is in the order of 0.25 m (in 1999), and growing by 0.025 m per year in UK and Ireland. This effect is only relevant in international scientific applications. For all navigation, mapping, GIS, and engineering applications within the tectonically stable parts of Europe (including UK and Ireland), the term ETRS89 should be taken as synonymous with WGS84.

In essence, this means that anywhere you see ETRS89 in this README, you can substitute WGS84.

What CRS Are My Data In

  • if you have latitude and longitude coordinates:
    • They're probably WGS84. Everything's fine!
  • if you got your coordinates from a smartphone or a consumer GPS:
    • They're probably WGS84. Everything's fine!
  • if you have x and y coordinates, or you got your coordinates from Google Maps or Bing Maps and they look something like (-626172.1357121646, 6887893.4928337997), or the phrase "Spherical Mercator" is mentioned anywhere:
    • they're probably in Web Mercator. You must convert them to WGS84 first. Use convert_epsg3857_to_wgs84([x_coordinates], [y_coordinates]) to do so.

Accuracy

convert_bng and convert_lonlat first use the standard seven-step Helmert transform to convert coordinates. This is fast, but not particularly accurate – it can introduce positional error up to approximately 5 metres. For most applications, this is not of particular concern – the input data (especially those originating with smartphone GPS) probably exceed this level of error in any case. In order to adjust for this, the OSTN15 adjustments for the kilometer-grid the ETRS89 point falls in are retrieved, and a linear interpolation to give final, accurate coordinates is carried out. This process happens in reverse for convert_lonlat.

OSTN15

OSTN15 data are used for highly accurate conversions from ETRS89 latitude and longitude, or ETRS89 Eastings and Northings to OSGB36 Eastings and Northings, and vice versa. These data will usually have been recorded using the National GPS Network:

Accuracy of Your Data

Conversion of your coordinates using OSTN15 transformations will be accurate, but if you're using consumer equipment, or got your data off the web, be aware that you're converting coordinates which probably weren't accurately recorded in the first place. That's because accurate surveying is difficult.

Accuracy of the OSTN15 transformation used in this library

  • ETRS89 longitude and latitude / Eastings and Northings to OSGB36 conversion agrees with the provided Ordnance Survey test data in 39 of the 40 test coordinates (excluding two coordinates designed to return no data; these correctly fail).
  • The only discrepancy – in point TP31– is 1mm.
  • OSGB36 to ETRS89 longitude and latitude conversion is accurate to within 8 decimal places, or 1.1mm.

A Note on Ellipsoids

WGS84 and ETRS89 coordinates use the GRS80 ellipsoid, whereas OSGB36 uses the Airy 1830 ellipsoid, which provides a regional best fit for Britain. Positions for coordinates in Great Britain can differ by over 100m as a result. It is thus inadvisable to attempt calculations using mixed ETRS89 and OSGB36 coordinates.

OSTN15

Implementation

The main detail of interest is the FFI interface between Python and Rust, the Python side of which can be found in util.py (the ctypes implementation), cutil.pyx (the cython implementation), and the Rust side of which can be found in ffi.rs.
The ctypes library expects C-compatible data structures, which we define in Rust (see above). We then define methods which allow us to receive, safely access, return, and free data across the FFI boundary.
Finally, we link the Rust conversion functions from util.py again. Note the errcheck assignments, which convert the FFI-compatible ctypes data structures to tuple lists.

Building the binary for local development

  • ensure you have Rust 1.x and Cargo installed
  • download the Rust extension for your platform from github
  • copy the binary into the convertbng directory
  • run python setup.py build_ext --inplace

Tests

  • install pytest
  • run pytest

License

MIT

Citing Convertbng

If Convertbng has been significant in your research, and you would like to acknowledge the project in your academic publication, we suggest citing it as follows (example in APA style, 7th edition):

Hügel, S. (2021). Convertbng (Version X.Y.Z) [Computer software]. https://doi.org/10.5281/zenodo.5774931

In Bibtex format:

@software{Hugel_Convertbng_2021,
author = {Hügel, Stephan},
doi = {10.5281/zenodo.5774931},
license = {MIT},
month = {12},
title = {{Convertbng}},
url = {https://github.com/urschrei/convertbng},
version = {X.Y.Z},
year = {2021}
}

convertbng's People

Contributors

dependabot[bot] avatar henryiii avatar liamato avatar snorfalorpagus avatar urschrei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

convertbng's Issues

Ubuntu 18.04 64bit: Illegal instruction (core dumped)

I have been using convertbng on a windows machine successfully and I attempted to move my code onto an ubuntu server and get an "Illegal instruction (core dumped)" error every time I try to call any function in this library.

I even tried with a very simple test case and then had the same issue. The following code works fine on the windows device but not on the linux server:

from convertbng.util import convert_bng
convert_bng([-1.89983], [52.48142])

Cheers,

pip install fails on Python 3.9.7 (Sep 16 2021) Windows 10

Collecting convertbng
Downloading convertbng-0.4.14.tar.gz (11.4 MB)
|████████████████████████████████| 11.4 MB 6.8 MB/s
Requirement already satisfied: numpy>=1.9.0 in c:\software\anaconda3\lib\site-packages (from convertbng) (1.20.3)
Building wheels for collected packages: convertbng
Building wheel for convertbng (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\software\Anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\User\AppData\Local\Temp\pip-install-ledaapm_\convertbng_4444f6d4434a49edbac4bacf9b4ff854\setup.py'"'"'; file='"'"'C:\Users\User\AppData\Local\Temp\pip-install-ledaapm_\convertbng_4444f6d4434a49edbac4bacf9b4ff854\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\User\AppData\Local\Temp\pip-wheel-fpqcoz6p'
cwd: C:\Users\User\AppData\Local\Temp\pip-install-ledaapm_\convertbng_4444f6d4434a49edbac4bacf9b4ff854
Complete output (29 lines):
running bdist_wheel
The [wheel] section is deprecated. Use [bdist_wheel] instead.
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\convertbng
copying convertbng\util.py -> build\lib.win-amd64-3.9\convertbng
copying convertbng_init_.py -> build\lib.win-amd64-3.9\convertbng
running egg_info
writing convertbng.egg-info\PKG-INFO
writing dependency_links to convertbng.egg-info\dependency_links.txt
writing requirements to convertbng.egg-info\requires.txt
writing top-level names to convertbng.egg-info\top_level.txt
reading manifest file 'convertbng.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'license.txt'
warning: no files found matching 'README.md'
warning: no files found matching 'ostn002_s.gif'
writing manifest file 'convertbng.egg-info\SOURCES.txt'
copying convertbng\convertbng_p.pxd -> build\lib.win-amd64-3.9\convertbng
copying convertbng\cutil.c -> build\lib.win-amd64-3.9\convertbng
copying convertbng\cutil.pyx -> build\lib.win-amd64-3.9\convertbng
copying convertbng\liblonlat_bng.dylib -> build\lib.win-amd64-3.9\convertbng
copying convertbng\liblonlat_bng.so -> build\lib.win-amd64-3.9\convertbng
copying convertbng\rlib.h -> build\lib.win-amd64-3.9\convertbng
running build_ext
building 'convertbng.cutil' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

ERROR: Failed building wheel for convertbng
Running setup.py clean for convertbng
Failed to build convertbng
Installing collected packages: convertbng
Running setup.py install for convertbng ... error
ERROR: Command errored out with exit status 1:
command: 'C:\software\Anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\User\AppData\Local\Temp\pip-install-ledaapm_\convertbng_4444f6d4434a49edbac4bacf9b4ff854\setup.py'"'"'; file='"'"'C:\Users\User\AppData\Local\Temp\pip-install-ledaapm_\convertbng_4444f6d4434a49edbac4bacf9b4ff854\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\User\AppData\Local\Temp\pip-record-f99gapzq\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\software\Anaconda3\Include\convertbng'
cwd: C:\Users\User\AppData\Local\Temp\pip-install-ledaapm_\convertbng_4444f6d4434a49edbac4bacf9b4ff854
Complete output (28 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\convertbng
copying convertbng\util.py -> build\lib.win-amd64-3.9\convertbng
copying convertbng_init_.py -> build\lib.win-amd64-3.9\convertbng
running egg_info
writing convertbng.egg-info\PKG-INFO
writing dependency_links to convertbng.egg-info\dependency_links.txt
writing requirements to convertbng.egg-info\requires.txt
writing top-level names to convertbng.egg-info\top_level.txt
reading manifest file 'convertbng.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'license.txt'
warning: no files found matching 'README.md'
warning: no files found matching 'ostn002_s.gif'
writing manifest file 'convertbng.egg-info\SOURCES.txt'
copying convertbng\convertbng_p.pxd -> build\lib.win-amd64-3.9\convertbng
copying convertbng\cutil.c -> build\lib.win-amd64-3.9\convertbng
copying convertbng\cutil.pyx -> build\lib.win-amd64-3.9\convertbng
copying convertbng\liblonlat_bng.dylib -> build\lib.win-amd64-3.9\convertbng
copying convertbng\liblonlat_bng.so -> build\lib.win-amd64-3.9\convertbng
copying convertbng\rlib.h -> build\lib.win-amd64-3.9\convertbng
running build_ext
building 'convertbng.cutil' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\software\Anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\User\AppData\Local\Temp\pip-install-ledaapm_\convertbng_4444f6d4434a49edbac4bacf9b4ff854\setup.py'"'"'; file='"'"'C:\Users\User\AppData\Local\Temp\pip-install-ledaapm_\convertbng_4444f6d4434a49edbac4bacf9b4ff854\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\User\AppData\Local\Temp\pip-record-f99gapzq\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\software\Anaconda3\Include\convertbng' Check the logs for full command output.

Instructions for installation on FreeBSD please

Hi,

I am attempting to install this on FreeBSD and I am having some trouble: could instructions be given for how to do this please?

My first attempt was a simple pip install --user convertbng which produced the following output:

Collecting convertbng
  Downloading convertbng-0.4.14.tar.gz (11.4 MB)
     |████████████████████████████████| 11.4 MB 5.9 MB/s 
Requirement already satisfied: numpy>=1.9.0 in /usr/local/lib/python3.7/site-packages (from convertbng) (1.16.6)
Using legacy 'setup.py install' for convertbng, since package 'wheel' is not installed.
Installing collected packages: convertbng
    Running setup.py install for convertbng ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0w8bv9zb/convertbng/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0w8bv9zb/convertbng/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-iqzv5ow2/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/foobar/.local/include/python3.7m/convertbng
         cwd: /tmp/pip-install-0w8bv9zb/convertbng/
    Complete output (138 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7
    creating build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/__init__.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/util.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    running egg_info
    writing convertbng.egg-info/PKG-INFO
    writing dependency_links to convertbng.egg-info/dependency_links.txt
    writing requirements to convertbng.egg-info/requires.txt
    writing top-level names to convertbng.egg-info/top_level.txt
    reading manifest file 'convertbng.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching 'license.txt'
    warning: no files found matching 'README.md'
    warning: no files found matching 'ostn002_s.gif'
    writing manifest file 'convertbng.egg-info/SOURCES.txt'
    copying convertbng/convertbng_p.pxd -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/cutil.c -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/cutil.pyx -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/liblonlat_bng.dylib -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/liblonlat_bng.so -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/rlib.h -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    running build_ext
    building 'convertbng.cutil' extension
    creating build/temp.freebsd-12.2-RELEASE-p3-amd64-3.7
    creating build/temp.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    cc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -march=native -fstack-protector-strong -fno-strict-aliasing -fPIC -I./convertbng -I. -Iconvertbng -I/usr/local/include/python3.7m -c convertbng/cutil.c -o build/temp.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng/cutil.o -O3
    convertbng/cutil.c:17618:21: error: no member named 'exc_type' in 'struct _ts'
        *type = tstate->exc_type;
                ~~~~~~  ^
    convertbng/cutil.c:17619:22: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
        *value = tstate->exc_value;
                         ^~~~~~~~~
                         curexc_value
    /usr/local/include/python3.7m/pystate.h:241:15: note: 'curexc_value' declared here
        PyObject *curexc_value;
                  ^
    convertbng/cutil.c:17620:19: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
        *tb = tstate->exc_traceback;
                      ^~~~~~~~~~~~~
                      curexc_traceback
    /usr/local/include/python3.7m/pystate.h:242:15: note: 'curexc_traceback' declared here
        PyObject *curexc_traceback;
                  ^
    convertbng/cutil.c:17627:24: error: no member named 'exc_type' in 'struct _ts'
        tmp_type = tstate->exc_type;
                   ~~~~~~  ^
    convertbng/cutil.c:17628:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
        tmp_value = tstate->exc_value;
                            ^~~~~~~~~
                            curexc_value
    /usr/local/include/python3.7m/pystate.h:241:15: note: 'curexc_value' declared here
        PyObject *curexc_value;
                  ^
    convertbng/cutil.c:17629:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
        tmp_tb = tstate->exc_traceback;
                         ^~~~~~~~~~~~~
                         curexc_traceback
    /usr/local/include/python3.7m/pystate.h:242:15: note: 'curexc_traceback' declared here
        PyObject *curexc_traceback;
                  ^
    convertbng/cutil.c:17630:13: error: no member named 'exc_type' in 'struct _ts'
        tstate->exc_type = type;
        ~~~~~~  ^
    convertbng/cutil.c:17631:13: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
        tstate->exc_value = value;
                ^~~~~~~~~
                curexc_value
    /usr/local/include/python3.7m/pystate.h:241:15: note: 'curexc_value' declared here
        PyObject *curexc_value;
                  ^
    convertbng/cutil.c:17632:13: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
        tstate->exc_traceback = tb;
                ^~~~~~~~~~~~~
                curexc_traceback
    /usr/local/include/python3.7m/pystate.h:242:15: note: 'curexc_traceback' declared here
        PyObject *curexc_traceback;
                  ^
    convertbng/cutil.c:17687:24: error: no member named 'exc_type' in 'struct _ts'
        tmp_type = tstate->exc_type;
                   ~~~~~~  ^
    convertbng/cutil.c:17688:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
        tmp_value = tstate->exc_value;
                            ^~~~~~~~~
                            curexc_value
    /usr/local/include/python3.7m/pystate.h:241:15: note: 'curexc_value' declared here
        PyObject *curexc_value;
                  ^
    convertbng/cutil.c:17689:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
        tmp_tb = tstate->exc_traceback;
                         ^~~~~~~~~~~~~
                         curexc_traceback
    /usr/local/include/python3.7m/pystate.h:242:15: note: 'curexc_traceback' declared here
        PyObject *curexc_traceback;
                  ^
    convertbng/cutil.c:17690:13: error: no member named 'exc_type' in 'struct _ts'
        tstate->exc_type = local_type;
        ~~~~~~  ^
    convertbng/cutil.c:17691:13: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
        tstate->exc_value = local_value;
                ^~~~~~~~~
                curexc_value
    /usr/local/include/python3.7m/pystate.h:241:15: note: 'curexc_value' declared here
        PyObject *curexc_value;
                  ^
    convertbng/cutil.c:17692:13: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
        tstate->exc_traceback = local_tb;
                ^~~~~~~~~~~~~
                curexc_traceback
    /usr/local/include/python3.7m/pystate.h:242:15: note: 'curexc_traceback' declared here
        PyObject *curexc_traceback;
                  ^
    convertbng/cutil.c:17714:24: error: no member named 'exc_type' in 'struct _ts'
        tmp_type = tstate->exc_type;
                   ~~~~~~  ^
    convertbng/cutil.c:17715:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
        tmp_value = tstate->exc_value;
                            ^~~~~~~~~
                            curexc_value
    /usr/local/include/python3.7m/pystate.h:241:15: note: 'curexc_value' declared here
        PyObject *curexc_value;
                  ^
    convertbng/cutil.c:17716:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
        tmp_tb = tstate->exc_traceback;
                         ^~~~~~~~~~~~~
                         curexc_traceback
    /usr/local/include/python3.7m/pystate.h:242:15: note: 'curexc_traceback' declared here
        PyObject *curexc_traceback;
                  ^
    convertbng/cutil.c:17717:13: error: no member named 'exc_type' in 'struct _ts'
        tstate->exc_type = *type;
        ~~~~~~  ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command 'cc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0w8bv9zb/convertbng/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0w8bv9zb/convertbng/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-iqzv5ow2/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/foobar/.local/include/python3.7m/convertbng Check the logs for full command output.

I suspected that it was not compatible with the default compiler, so I set $CC to "/usr/local/bin/gcc10" and tried again, which produced the following output:

Collecting convertbng
  Using cached convertbng-0.4.14.tar.gz (11.4 MB)
Requirement already satisfied: numpy>=1.9.0 in /usr/local/lib/python3.7/site-packages (from convertbng) (1.16.6)
Using legacy 'setup.py install' for convertbng, since package 'wheel' is not installed.
Installing collected packages: convertbng
    Running setup.py install for convertbng ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1ja939i9/convertbng/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1ja939i9/convertbng/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-k4sou7is/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/foobar/.local/include/python3.7m/convertbng
         cwd: /tmp/pip-install-1ja939i9/convertbng/
    Complete output (119 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7
    creating build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/__init__.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/util.py -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    running egg_info
    writing convertbng.egg-info/PKG-INFO
    writing dependency_links to convertbng.egg-info/dependency_links.txt
    writing requirements to convertbng.egg-info/requires.txt
    writing top-level names to convertbng.egg-info/top_level.txt
    reading manifest file 'convertbng.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching 'license.txt'
    warning: no files found matching 'README.md'
    warning: no files found matching 'ostn002_s.gif'
    writing manifest file 'convertbng.egg-info/SOURCES.txt'
    copying convertbng/convertbng_p.pxd -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/cutil.c -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/cutil.pyx -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/liblonlat_bng.dylib -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/liblonlat_bng.so -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    copying convertbng/rlib.h -> build/lib.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    running build_ext
    building 'convertbng.cutil' extension
    creating build/temp.freebsd-12.2-RELEASE-p3-amd64-3.7
    creating build/temp.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng
    /usr/local/bin/gcc10 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -march=native -fstack-protector-strong -fno-strict-aliasing -fPIC -I./convertbng -I. -Iconvertbng -I/usr/local/include/python3.7m -c convertbng/cutil.c -o build/temp.freebsd-12.2-RELEASE-p3-amd64-3.7/convertbng/cutil.o -O3
    convertbng/cutil.c: In function '__Pyx__ExceptionSave':
    convertbng/cutil.c:17618:21: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_type'; did you mean 'curexc_type'?
    17618 |     *type = tstate->exc_type;
          |                     ^~~~~~~~
          |                     curexc_type
    convertbng/cutil.c:17619:22: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_value'; did you mean 'curexc_value'?
    17619 |     *value = tstate->exc_value;
          |                      ^~~~~~~~~
          |                      curexc_value
    convertbng/cutil.c:17620:19: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_traceback'; did you mean 'curexc_traceback'?
    17620 |     *tb = tstate->exc_traceback;
          |                   ^~~~~~~~~~~~~
          |                   curexc_traceback
    convertbng/cutil.c: In function '__Pyx__ExceptionReset':
    convertbng/cutil.c:17627:24: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_type'; did you mean 'curexc_type'?
    17627 |     tmp_type = tstate->exc_type;
          |                        ^~~~~~~~
          |                        curexc_type
    convertbng/cutil.c:17628:25: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_value'; did you mean 'curexc_value'?
    17628 |     tmp_value = tstate->exc_value;
          |                         ^~~~~~~~~
          |                         curexc_value
    convertbng/cutil.c:17629:22: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_traceback'; did you mean 'curexc_traceback'?
    17629 |     tmp_tb = tstate->exc_traceback;
          |                      ^~~~~~~~~~~~~
          |                      curexc_traceback
    convertbng/cutil.c:17630:13: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_type'; did you mean 'curexc_type'?
    17630 |     tstate->exc_type = type;
          |             ^~~~~~~~
          |             curexc_type
    convertbng/cutil.c:17631:13: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_value'; did you mean 'curexc_value'?
    17631 |     tstate->exc_value = value;
          |             ^~~~~~~~~
          |             curexc_value
    convertbng/cutil.c:17632:13: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_traceback'; did you mean 'curexc_traceback'?
    17632 |     tstate->exc_traceback = tb;
          |             ^~~~~~~~~~~~~
          |             curexc_traceback
    convertbng/cutil.c: In function '__Pyx__GetException':
    convertbng/cutil.c:17687:24: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_type'; did you mean 'curexc_type'?
    17687 |     tmp_type = tstate->exc_type;
          |                        ^~~~~~~~
          |                        curexc_type
    convertbng/cutil.c:17688:25: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_value'; did you mean 'curexc_value'?
    17688 |     tmp_value = tstate->exc_value;
          |                         ^~~~~~~~~
          |                         curexc_value
    convertbng/cutil.c:17689:22: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_traceback'; did you mean 'curexc_traceback'?
    17689 |     tmp_tb = tstate->exc_traceback;
          |                      ^~~~~~~~~~~~~
          |                      curexc_traceback
    convertbng/cutil.c:17690:13: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_type'; did you mean 'curexc_type'?
    17690 |     tstate->exc_type = local_type;
          |             ^~~~~~~~
          |             curexc_type
    convertbng/cutil.c:17691:13: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_value'; did you mean 'curexc_value'?
    17691 |     tstate->exc_value = local_value;
          |             ^~~~~~~~~
          |             curexc_value
    convertbng/cutil.c:17692:13: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_traceback'; did you mean 'curexc_traceback'?
    17692 |     tstate->exc_traceback = local_tb;
          |             ^~~~~~~~~~~~~
          |             curexc_traceback
    convertbng/cutil.c: In function '__Pyx__ExceptionSwap':
    convertbng/cutil.c:17714:24: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_type'; did you mean 'curexc_type'?
    17714 |     tmp_type = tstate->exc_type;
          |                        ^~~~~~~~
          |                        curexc_type
    convertbng/cutil.c:17715:25: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_value'; did you mean 'curexc_value'?
    17715 |     tmp_value = tstate->exc_value;
          |                         ^~~~~~~~~
          |                         curexc_value
    convertbng/cutil.c:17716:22: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_traceback'; did you mean 'curexc_traceback'?
    17716 |     tmp_tb = tstate->exc_traceback;
          |                      ^~~~~~~~~~~~~
          |                      curexc_traceback
    convertbng/cutil.c:17717:13: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_type'; did you mean 'curexc_type'?
    17717 |     tstate->exc_type = *type;
          |             ^~~~~~~~
          |             curexc_type
    convertbng/cutil.c:17718:13: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_value'; did you mean 'curexc_value'?
    17718 |     tstate->exc_value = *value;
          |             ^~~~~~~~~
          |             curexc_value
    convertbng/cutil.c:17719:13: error: 'PyThreadState' {aka 'struct _ts'} has no member named 'exc_traceback'; did you mean 'curexc_traceback'?
    17719 |     tstate->exc_traceback = *tb;
          |             ^~~~~~~~~~~~~
          |             curexc_traceback
    error: command '/usr/local/bin/gcc10' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1ja939i9/convertbng/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1ja939i9/convertbng/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-k4sou7is/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/foobar/.local/include/python3.7m/convertbng Check the logs for full command output.

Do you have any ideas for how to solve this?

Thank you

pip install convertbng fails on Python 3.11

pip install convertbng fails on Python 3.11 with error:

      convertbng/cutil.c:77:12: fatal error: 'longintrepr.h' file not found
        #include "longintrepr.h"

This seems to be due to a change to cython, e.g. see here: aio-libs/aiohttp#6600

Switching to Python 3.10 fixed this.

This was experienced on macOS using conda with arm hardware, but it looks like it's more general than that.

Windows 10 64 bits installation trouble

Hi, on windows i try without success to install directly frmo github like you say in the install notes.

i'm with python 3.8.0 and a venv

Below is a copy of my console screen
best regards
Lou

`(venv) C:\Users\Lou\PycharmProjects\pythonpur\venv>pip install git+git://github.com/urschrei/convertbng.git
Collecting git+git://github.com/urschrei/convertbng.git
Cloning git://github.com/urschrei/convertbng.git to c:\users\lou\appdata\local\temp\pip-req-build-61jmj1ne
Running command git clone -q git://github.com/urschrei/convertbng.git 'C:\Users\Lou\AppData\Local\Temp\pip-req-build-61jmj1ne'
Requirement already satisfied: numpy>=1.11.0 in c:\users\lou\pycharmprojects\pythonpur\venv\lib\site-packages (from convertbng==0.6.18) (1.19.0)
Using legacy setup.py install for convertbng, since package 'wheel' is not installed.
Installing collected packages: convertbng
Running setup.py install for convertbng ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\lou\pycharmprojects\pythonpur\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Lou\AppData\Local\Temp\pip-req-build-61jmj1ne\setup.py'"'"'; file='"'"'C:
\Users\Lou\AppData\Local\Temp\pip-req-build-61jmj1ne\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"')
)' install --record 'C:\Users\Lou\AppData\Local\Temp\pip-record-l26whna_\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\lou\pycharmprojects\pythonpur\venv\include\site\python3.8\convert
bng'
cwd: C:\Users\Lou\AppData\Local\Temp\pip-req-build-61jmj1ne
Complete output (42 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\convertbng
copying convertbng\util.py -> build\lib.win32-3.8\convertbng
copying convertbng_init_.py -> build\lib.win32-3.8\convertbng
creating build\lib.win32-3.8\convertbng\test
copying convertbng\test\test_convertbng.py -> build\lib.win32-3.8\convertbng\test
copying convertbng\test_init_.py -> build\lib.win32-3.8\convertbng\test
running egg_info
creating convertbng.egg-info
writing convertbng.egg-info\PKG-INFO
writing dependency_links to convertbng.egg-info\dependency_links.txt
writing requirements to convertbng.egg-info\requires.txt
writing top-level names to convertbng.egg-info\top_level.txt
writing manifest file 'convertbng.egg-info\SOURCES.txt'
reading manifest file 'convertbng.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README.rst'
warning: no files found matching '.so' under directory 'convertbng'
warning: no files found matching '
.dylib' under directory 'convertbng'
warning: no files found matching '.dll' under directory 'convertbng'
warning: no files found matching '
.lib' under directory 'convertbng'
writing manifest file 'convertbng.egg-info\SOURCES.txt'
copying convertbng\convertbng_p.pxd -> build\lib.win32-3.8\convertbng
copying convertbng\cutil.c -> build\lib.win32-3.8\convertbng
copying convertbng\cutil.pyx -> build\lib.win32-3.8\convertbng
copying convertbng\header.h -> build\lib.win32-3.8\convertbng
copying convertbng\stdbool.h -> build\lib.win32-3.8\convertbng
running build_ext
building 'convertbng.cutil' extension
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\convertbng
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iconvertbng -Ic:\users\lou\pycharmprojects\pythonpur\venv\include -IC:\Users\Lo
u\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\Lou\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\include" "-IC:\Program
Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits
10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcconvertbng/cutil.c /Fobuild\temp.win32-3.8\Release\convertbng/cutil.obj -O3
clÿ: Ligne de commande warning D9002ÿ: option '-O3' inconnue ignor‚e
cutil.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:convertbng /LIBPATH:c:\users\lou
pycharmprojects\pythonpur\venv\libs /LIBPATH:C:\Users\Lou\AppData\Local\Programs\Python\Python38-32\libs /LIBPATH:C:\Users\Lou\AppData\Local\Programs\Python\Python38-32 /LIBPATH:c:\users\lou\pycharmprojects\pythonpur\venv\PCbuild\wi
n32 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\lib\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x86" "/LIBPATH:C:\Program Files (x86)\Windows Kit
s\10\lib\10.0.18362.0\um\x86" lonlat_bng.lib /EXPORT:PyInit_cutil build\temp.win32-3.8\Release\convertbng/cutil.obj /OUT:build\lib.win32-3.8\convertbng\cutil.cp38-win32.pyd /IMPLIB:build\temp.win32-3.8\Release\convertbng\cutil.cp38-
win32.lib
LINK : fatal error LNK1181: impossible d'ouvrir le fichier en entr‚e 'lonlat_bng.lib'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\link.exe' failed with exit status 1181
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\lou\pycharmprojects\pythonpur\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Lou\AppData\Local\Temp\pip-req-build-61jmj1ne
\setup.py'"'"'; file='"'"'C:\Users\Lou\AppData\Local\Temp\pip-req-build-61jmj1ne\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compil
e(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Lou\AppData\Local\Temp\pip-record-l26whna_\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\lou\pycharmprojects\pythonpur\ve
nv\include\site\python3.8\convertbng' Check the logs for full command output.

`

Intermittent Segmentation faults on Ubuntu-20.04 LTS on WSL2

Hi, I've been using this for a while on both Ubuntu-20.04 within WSL2.

I've recently noticed that the Python script aborts with "Segmentation fault" in some cases, but unfortunately it's a little intermittent - it only occurs during one long processing run, but sometimes happens earlier or later. This involves lots of individual calls to convert shorter line strings (supplied as lists to convert_bng).

If I make individual calls with each of these linestrings within the same venv, these work fine - the problem only arises when the processing script runs as a whole.

All the 0.6.* versions seem to have this same behaviour. The latest prior version that I seem to be able to install is 0.4.4, which appears to work fine, but uses OSTN02.

Details:

  • System installed Python 3.8.5.
  • Additional libraries including this one installed in virtualenv using pip.
  • No other problems to date with NumPy or any other Python libraries I can think of.

I appreciate it's not much to go on, but let me know if you would like some more information!

Error installing on Mac with python 3.9

I followed the instructions and get the following error:

% pip install convertbng
Collecting convertbng
  Using cached convertbng-0.4.14.tar.gz (11.4 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.9.0 in /usr/local/anaconda3/envs/ox/lib/python3.9/site-packages (from convertbng) (1.21.2)
Building wheels for collected packages: convertbng
  Building wheel for convertbng (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/anaconda3/envs/ox/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/69/yzd_1s491f11q4sy0w00msy80000gn/T/pip-install-s41uf3lb/convertbng_58adb7d95e09486fb5ede4ee063e7f51/setup.py'"'"'; __file__='"'"'/private/var/folders/69/yzd_1s491f11q4sy0w00msy80000gn/T/pip-install-s41uf3lb/convertbng_58adb7d95e09486fb5ede4ee063e7f51/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/69/yzd_1s491f11q4sy0w00msy80000gn/T/pip-wheel-vmdzykbb
       cwd: /private/var/folders/69/yzd_1s491f11q4sy0w00msy80000gn/T/pip-install-s41uf3lb/convertbng_58adb7d95e09486fb5ede4ee063e7f51/
  Complete output (322 lines):
  running bdist_wheel
  The [wheel] section is deprecated. Use [bdist_wheel] instead.
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.9
  creating build/lib.macosx-10.9-x86_64-3.9/convertbng
  copying convertbng/util.py -> build/lib.macosx-10.9-x86_64-3.9/convertbng
  copying convertbng/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/convertbng
  running egg_info
  writing convertbng.egg-info/PKG-INFO
  writing dependency_links to convertbng.egg-info/dependency_links.txt
  writing requirements to convertbng.egg-info/requires.txt
  writing top-level names to convertbng.egg-info/top_level.txt
  reading manifest file 'convertbng.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching 'license.txt'
  warning: no files found matching 'README.md'
  warning: no files found matching 'ostn002_s.gif'
  writing manifest file 'convertbng.egg-info/SOURCES.txt'
  copying convertbng/convertbng_p.pxd -> build/lib.macosx-10.9-x86_64-3.9/convertbng
  copying convertbng/cutil.c -> build/lib.macosx-10.9-x86_64-3.9/convertbng
  copying convertbng/cutil.pyx -> build/lib.macosx-10.9-x86_64-3.9/convertbng
  copying convertbng/liblonlat_bng.dylib -> build/lib.macosx-10.9-x86_64-3.9/convertbng
  copying convertbng/liblonlat_bng.so -> build/lib.macosx-10.9-x86_64-3.9/convertbng
  copying convertbng/rlib.h -> build/lib.macosx-10.9-x86_64-3.9/convertbng
  running build_ext
  building 'convertbng.cutil' extension
  creating build/temp.macosx-10.9-x86_64-3.9
  creating build/temp.macosx-10.9-x86_64-3.9/convertbng
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /usr/local/anaconda3/envs/ox/include -fPIC -O2 -isystem /usr/local/anaconda3/envs/ox/include -I/usr/local/opt/icu4c/include -I. -Iconvertbng -I/usr/local/anaconda3/envs/ox/include/python3.9 -c convertbng/cutil.c -o build/temp.macosx-10.9-x86_64-3.9/convertbng/cutil.o -O3
  convertbng/cutil.c:15295:94: error: no member named 'tp_print' in 'struct _typeobject'
    __pyx_type_10convertbng_5cutil___pyx_scope_struct____pyx_f_10convertbng_5cutil_ffi_wrapper.tp_print = 0;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
  convertbng/cutil.c:15300:26: error: no member named 'tp_print' in 'struct _typeobject'
    __pyx_type___pyx_array.tp_print = 0;
    ~~~~~~~~~~~~~~~~~~~~~~ ^
  convertbng/cutil.c:15304:32: error: no member named 'tp_print' in 'struct _typeobject'
    __pyx_type___pyx_MemviewEnum.tp_print = 0;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
  convertbng/cutil.c:15315:31: error: no member named 'tp_print' in 'struct _typeobject'
    __pyx_type___pyx_memoryview.tp_print = 0;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
  convertbng/cutil.c:15324:36: error: no member named 'tp_print' in 'struct _typeobject'
    __pyx_type___pyx_memoryviewslice.tp_print = 0;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
  convertbng/cutil.c:15743:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                      (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                       ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
        PyUnicode_WSTR_LENGTH(op) :                    \
        ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
  #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                    ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3)
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:15743:22: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                      (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                       ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
        ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
               ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:15743:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                      (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                       ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
         PyUnicode_WSTR_LENGTH(op)))
         ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
  #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                    ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3)
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:15743:52: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                      (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                     ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
        PyUnicode_WSTR_LENGTH(op) :                    \
        ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
  #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                    ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3)
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:15743:52: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                      (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                     ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
        ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
               ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:15743:52: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                      (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                     ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
         PyUnicode_WSTR_LENGTH(op)))
         ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
  #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                    ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3)
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:15759:26: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                          (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                           ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
        PyUnicode_WSTR_LENGTH(op) :                    \
        ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
  #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                    ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3)
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:15759:26: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                          (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                           ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
        ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
               ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:15759:26: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                          (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                           ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
         PyUnicode_WSTR_LENGTH(op)))
         ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
  #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                    ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3)
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:15759:59: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                          (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                            ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
        PyUnicode_WSTR_LENGTH(op) :                    \
        ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
  #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                    ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3)
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:15759:59: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                          (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                            ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
        ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
               ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:15759:59: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                          (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                            ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
         PyUnicode_WSTR_LENGTH(op)))
         ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
  #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                    ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3)
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:17096:9: warning: 'PyCFunction_Call' is deprecated [-Wdeprecated-declarations]
          return PyCFunction_Call(func, arg, kw);
                 ^
  /usr/local/anaconda3/envs/ox/include/python3.9/methodobject.h:33:1: note: 'PyCFunction_Call' has been explicitly marked deprecated here
  Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:17161:41: warning: 'PyCFunction_Call' is deprecated [-Wdeprecated-declarations]
      __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
                                          ^
  /usr/local/anaconda3/envs/ox/include/python3.9/methodobject.h:33:1: note: 'PyCFunction_Call' has been explicitly marked deprecated here
  Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:17575:16: warning: 'PyUnicode_FromUnicode' is deprecated [-Wdeprecated-declarations]
          return PyUnicode_FromUnicode(NULL, 0);
                 ^
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here
  Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
  ^
  /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
  #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                       ^
  convertbng/cutil.c:17618:21: error: no member named 'exc_type' in 'struct _ts'
      *type = tstate->exc_type;
              ~~~~~~  ^
  convertbng/cutil.c:17619:22: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
      *value = tstate->exc_value;
                       ^~~~~~~~~
                       curexc_value
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:80:15: note: 'curexc_value' declared here
      PyObject *curexc_value;
                ^
  convertbng/cutil.c:17620:19: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
      *tb = tstate->exc_traceback;
                    ^~~~~~~~~~~~~
                    curexc_traceback
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
      PyObject *curexc_traceback;
                ^
  convertbng/cutil.c:17627:24: error: no member named 'exc_type' in 'struct _ts'
      tmp_type = tstate->exc_type;
                 ~~~~~~  ^
  convertbng/cutil.c:17628:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
      tmp_value = tstate->exc_value;
                          ^~~~~~~~~
                          curexc_value
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:80:15: note: 'curexc_value' declared here
      PyObject *curexc_value;
                ^
  convertbng/cutil.c:17629:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
      tmp_tb = tstate->exc_traceback;
                       ^~~~~~~~~~~~~
                       curexc_traceback
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
      PyObject *curexc_traceback;
                ^
  convertbng/cutil.c:17630:13: error: no member named 'exc_type' in 'struct _ts'
      tstate->exc_type = type;
      ~~~~~~  ^
  convertbng/cutil.c:17631:13: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
      tstate->exc_value = value;
              ^~~~~~~~~
              curexc_value
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:80:15: note: 'curexc_value' declared here
      PyObject *curexc_value;
                ^
  convertbng/cutil.c:17632:13: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
      tstate->exc_traceback = tb;
              ^~~~~~~~~~~~~
              curexc_traceback
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
      PyObject *curexc_traceback;
                ^
  convertbng/cutil.c:17687:24: error: no member named 'exc_type' in 'struct _ts'
      tmp_type = tstate->exc_type;
                 ~~~~~~  ^
  convertbng/cutil.c:17688:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
      tmp_value = tstate->exc_value;
                          ^~~~~~~~~
                          curexc_value
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:80:15: note: 'curexc_value' declared here
      PyObject *curexc_value;
                ^
  convertbng/cutil.c:17689:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
      tmp_tb = tstate->exc_traceback;
                       ^~~~~~~~~~~~~
                       curexc_traceback
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
      PyObject *curexc_traceback;
                ^
  convertbng/cutil.c:17690:13: error: no member named 'exc_type' in 'struct _ts'
      tstate->exc_type = local_type;
      ~~~~~~  ^
  convertbng/cutil.c:17691:13: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
      tstate->exc_value = local_value;
              ^~~~~~~~~
              curexc_value
  /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:80:15: note: 'curexc_value' declared here
      PyObject *curexc_value;
                ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  15 warnings and 20 errors generated.
  error: command '/usr/bin/clang' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for convertbng
  Running setup.py clean for convertbng
Failed to build convertbng
Installing collected packages: convertbng
    Running setup.py install for convertbng ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/anaconda3/envs/ox/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/69/yzd_1s491f11q4sy0w00msy80000gn/T/pip-install-s41uf3lb/convertbng_58adb7d95e09486fb5ede4ee063e7f51/setup.py'"'"'; __file__='"'"'/private/var/folders/69/yzd_1s491f11q4sy0w00msy80000gn/T/pip-install-s41uf3lb/convertbng_58adb7d95e09486fb5ede4ee063e7f51/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/69/yzd_1s491f11q4sy0w00msy80000gn/T/pip-record-qng84efr/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/anaconda3/envs/ox/include/python3.9/convertbng
         cwd: /private/var/folders/69/yzd_1s491f11q4sy0w00msy80000gn/T/pip-install-s41uf3lb/convertbng_58adb7d95e09486fb5ede4ee063e7f51/
    Complete output (321 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.9
    creating build/lib.macosx-10.9-x86_64-3.9/convertbng
    copying convertbng/util.py -> build/lib.macosx-10.9-x86_64-3.9/convertbng
    copying convertbng/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/convertbng
    running egg_info
    writing convertbng.egg-info/PKG-INFO
    writing dependency_links to convertbng.egg-info/dependency_links.txt
    writing requirements to convertbng.egg-info/requires.txt
    writing top-level names to convertbng.egg-info/top_level.txt
    reading manifest file 'convertbng.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching 'license.txt'
    warning: no files found matching 'README.md'
    warning: no files found matching 'ostn002_s.gif'
    writing manifest file 'convertbng.egg-info/SOURCES.txt'
    copying convertbng/convertbng_p.pxd -> build/lib.macosx-10.9-x86_64-3.9/convertbng
    copying convertbng/cutil.c -> build/lib.macosx-10.9-x86_64-3.9/convertbng
    copying convertbng/cutil.pyx -> build/lib.macosx-10.9-x86_64-3.9/convertbng
    copying convertbng/liblonlat_bng.dylib -> build/lib.macosx-10.9-x86_64-3.9/convertbng
    copying convertbng/liblonlat_bng.so -> build/lib.macosx-10.9-x86_64-3.9/convertbng
    copying convertbng/rlib.h -> build/lib.macosx-10.9-x86_64-3.9/convertbng
    running build_ext
    building 'convertbng.cutil' extension
    creating build/temp.macosx-10.9-x86_64-3.9
    creating build/temp.macosx-10.9-x86_64-3.9/convertbng
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /usr/local/anaconda3/envs/ox/include -fPIC -O2 -isystem /usr/local/anaconda3/envs/ox/include -I/usr/local/opt/icu4c/include -I. -Iconvertbng -I/usr/local/anaconda3/envs/ox/include/python3.9 -c convertbng/cutil.c -o build/temp.macosx-10.9-x86_64-3.9/convertbng/cutil.o -O3
    convertbng/cutil.c:15295:94: error: no member named 'tp_print' in 'struct _typeobject'
      __pyx_type_10convertbng_5cutil___pyx_scope_struct____pyx_f_10convertbng_5cutil_ffi_wrapper.tp_print = 0;
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
    convertbng/cutil.c:15300:26: error: no member named 'tp_print' in 'struct _typeobject'
      __pyx_type___pyx_array.tp_print = 0;
      ~~~~~~~~~~~~~~~~~~~~~~ ^
    convertbng/cutil.c:15304:32: error: no member named 'tp_print' in 'struct _typeobject'
      __pyx_type___pyx_MemviewEnum.tp_print = 0;
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
    convertbng/cutil.c:15315:31: error: no member named 'tp_print' in 'struct _typeobject'
      __pyx_type___pyx_memoryview.tp_print = 0;
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
    convertbng/cutil.c:15324:36: error: no member named 'tp_print' in 'struct _typeobject'
      __pyx_type___pyx_memoryviewslice.tp_print = 0;
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
    convertbng/cutil.c:15743:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                        (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                         ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
          PyUnicode_WSTR_LENGTH(op) :                    \
          ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
    #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                      ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3)
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:15743:22: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                        (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                         ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
          ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
                 ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:15743:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                        (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                         ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
           PyUnicode_WSTR_LENGTH(op)))
           ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
    #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                      ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3)
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:15743:52: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                        (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                       ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
          PyUnicode_WSTR_LENGTH(op) :                    \
          ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
    #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                      ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3)
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:15743:52: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                        (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                       ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
          ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
                 ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:15743:52: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                        (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                       ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
           PyUnicode_WSTR_LENGTH(op)))
           ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
    #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                      ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3)
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:15759:26: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                            (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                             ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
          PyUnicode_WSTR_LENGTH(op) :                    \
          ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
    #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                      ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3)
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:15759:26: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                            (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                             ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
          ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
                 ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:15759:26: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                            (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                             ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
           PyUnicode_WSTR_LENGTH(op)))
           ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
    #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                      ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3)
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:15759:59: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                            (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                              ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
          PyUnicode_WSTR_LENGTH(op) :                    \
          ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
    #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                      ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3)
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:15759:59: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                            (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                              ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
          ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
                 ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:15759:59: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                            (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                              ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
           PyUnicode_WSTR_LENGTH(op)))
           ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
    #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                      ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3)
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:17096:9: warning: 'PyCFunction_Call' is deprecated [-Wdeprecated-declarations]
            return PyCFunction_Call(func, arg, kw);
                   ^
    /usr/local/anaconda3/envs/ox/include/python3.9/methodobject.h:33:1: note: 'PyCFunction_Call' has been explicitly marked deprecated here
    Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:17161:41: warning: 'PyCFunction_Call' is deprecated [-Wdeprecated-declarations]
        __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
                                            ^
    /usr/local/anaconda3/envs/ox/include/python3.9/methodobject.h:33:1: note: 'PyCFunction_Call' has been explicitly marked deprecated here
    Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:17575:16: warning: 'PyUnicode_FromUnicode' is deprecated [-Wdeprecated-declarations]
            return PyUnicode_FromUnicode(NULL, 0);
                   ^
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here
    Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
    ^
    /usr/local/anaconda3/envs/ox/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
    #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                         ^
    convertbng/cutil.c:17618:21: error: no member named 'exc_type' in 'struct _ts'
        *type = tstate->exc_type;
                ~~~~~~  ^
    convertbng/cutil.c:17619:22: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
        *value = tstate->exc_value;
                         ^~~~~~~~~
                         curexc_value
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:80:15: note: 'curexc_value' declared here
        PyObject *curexc_value;
                  ^
    convertbng/cutil.c:17620:19: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
        *tb = tstate->exc_traceback;
                      ^~~~~~~~~~~~~
                      curexc_traceback
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
        PyObject *curexc_traceback;
                  ^
    convertbng/cutil.c:17627:24: error: no member named 'exc_type' in 'struct _ts'
        tmp_type = tstate->exc_type;
                   ~~~~~~  ^
    convertbng/cutil.c:17628:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
        tmp_value = tstate->exc_value;
                            ^~~~~~~~~
                            curexc_value
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:80:15: note: 'curexc_value' declared here
        PyObject *curexc_value;
                  ^
    convertbng/cutil.c:17629:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
        tmp_tb = tstate->exc_traceback;
                         ^~~~~~~~~~~~~
                         curexc_traceback
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
        PyObject *curexc_traceback;
                  ^
    convertbng/cutil.c:17630:13: error: no member named 'exc_type' in 'struct _ts'
        tstate->exc_type = type;
        ~~~~~~  ^
    convertbng/cutil.c:17631:13: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
        tstate->exc_value = value;
                ^~~~~~~~~
                curexc_value
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:80:15: note: 'curexc_value' declared here
        PyObject *curexc_value;
                  ^
    convertbng/cutil.c:17632:13: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
        tstate->exc_traceback = tb;
                ^~~~~~~~~~~~~
                curexc_traceback
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
        PyObject *curexc_traceback;
                  ^
    convertbng/cutil.c:17687:24: error: no member named 'exc_type' in 'struct _ts'
        tmp_type = tstate->exc_type;
                   ~~~~~~  ^
    convertbng/cutil.c:17688:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
        tmp_value = tstate->exc_value;
                            ^~~~~~~~~
                            curexc_value
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:80:15: note: 'curexc_value' declared here
        PyObject *curexc_value;
                  ^
    convertbng/cutil.c:17689:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
        tmp_tb = tstate->exc_traceback;
                         ^~~~~~~~~~~~~
                         curexc_traceback
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:81:15: note: 'curexc_traceback' declared here
        PyObject *curexc_traceback;
                  ^
    convertbng/cutil.c:17690:13: error: no member named 'exc_type' in 'struct _ts'
        tstate->exc_type = local_type;
        ~~~~~~  ^
    convertbng/cutil.c:17691:13: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
        tstate->exc_value = local_value;
                ^~~~~~~~~
                curexc_value
    /usr/local/anaconda3/envs/ox/include/python3.9/cpython/pystate.h:80:15: note: 'curexc_value' declared here
        PyObject *curexc_value;
                  ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    15 warnings and 20 errors generated.
    error: command '/usr/bin/clang' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/anaconda3/envs/ox/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/69/yzd_1s491f11q4sy0w00msy80000gn/T/pip-install-s41uf3lb/convertbng_58adb7d95e09486fb5ede4ee063e7f51/setup.py'"'"'; __file__='"'"'/private/var/folders/69/yzd_1s491f11q4sy0w00msy80000gn/T/pip-install-s41uf3lb/convertbng_58adb7d95e09486fb5ede4ee063e7f51/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/69/yzd_1s491f11q4sy0w00msy80000gn/T/pip-record-qng84efr/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/anaconda3/envs/ox/include/python3.9/convertbng Check the logs for full command output.

Ubuntu 16.04 64bit: trap invalid opcode ... in liblonlat_bng-783571af.so

Hi there,

I have a flask application which uses convertbng to convert some OSGB36 eastings northings returned from a sqlite query into WGS84 coordinates. I just experimentally redeployed the production code running fine on Ubuntu 14.04 64bit (E3-1225 v2) onto a Ubuntu 16.04 64bit environment (i5-3570S).

The version of Python is 2.7.12, the version of convertbng is 0.5.5. The kernel is Linux 4.4.0-64-generic #85-Ubuntu.

Everything works fine, except this conversion:

    Feb 26 22:28:28 (hostname) kernel: [180221.207469] traps: uwsgi[22644] trap invalid opcode ip:7f32a27968f2 sp:7fff2f6a6bc8 error:0 in liblonlat_bng-783571af.so[7f32a272d000+1d2a000]

This in turn causes an Illegal instruction (core dumped) by Python, and in turn causes a remote host closing connection prematurely by NGINX which is running reverse proxy of the flask application.

While I don't speak Rust, it appears that this is something to do with the Rust binary called by the library?

For reference, the Python code that can reproduce this error is:

from convertbng.util import convert_lonlat

def bng_to_longlat(bng):
    """ Given a pair of BNG coordinates return its long and lat coordinates. """
    
    try:
        easting = [int(bng[0])]
        northing = [int(bng[1])]
        coordinates = convert_lonlat(easting, northing)
        coordinate_long = coordinates[0][0]
        coordinate_lat = coordinates[1][0]

        if isnan(coordinate_long) or isnan(coordinate_lat):
            return False
    
        return (coordinate_long, coordinate_lat)
    
    except ValueError:
        return False
 
bng_to_longlat((20000,20000))

Thanks.

Minor documentation typo

Minor issue with the readme.md. It currently gives the bounding box as

Latitude:
East: 1.7800
West: -7.5600
Longitude:
North: 60.8400
South: 49.9600

But "Latitude" and "Longitude" are the wrong way around.

pip install fails on Fedora with Python 3.9

Hello!
I've just tried to install with pip install convertbng on a Fedora 34 system with Python 3.9.7 and pip 21.0.1
But instead of getting a precompiled wheel I get the error below:

Collecting convertbng
  Downloading convertbng-0.4.14.tar.gz (11.4 MB)
     || 11.4 MB 15.6 MB/s 
Requirement already satisfied: numpy>=1.9.0 in /usr/lib64/python3.9/site-packages (from convertbng) (1.20.1)
Building wheels for collected packages: convertbng
  Building wheel for convertbng (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_ufjipy2/convertbng_204bed7928eb4be98740af3d324000c8/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_ufjipy2/convertbng_204bed7928eb4be98740af3d324000c8/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-pxo19kn1
       cwd: /tmp/pip-install-_ufjipy2/convertbng_204bed7928eb4be98740af3d324000c8/
  Complete output (273 lines):
  running bdist_wheel
  The [wheel] section is deprecated. Use [bdist_wheel] instead.
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.9
  creating build/lib.linux-x86_64-3.9/convertbng
  copying convertbng/util.py -> build/lib.linux-x86_64-3.9/convertbng
  copying convertbng/__init__.py -> build/lib.linux-x86_64-3.9/convertbng
  running egg_info
  writing convertbng.egg-info/PKG-INFO
  writing dependency_links to convertbng.egg-info/dependency_links.txt
  writing requirements to convertbng.egg-info/requires.txt
  writing top-level names to convertbng.egg-info/top_level.txt
  reading manifest file 'convertbng.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching 'license.txt'
  warning: no files found matching 'README.md'
  warning: no files found matching 'ostn002_s.gif'
  writing manifest file 'convertbng.egg-info/SOURCES.txt'
  copying convertbng/convertbng_p.pxd -> build/lib.linux-x86_64-3.9/convertbng
  copying convertbng/cutil.c -> build/lib.linux-x86_64-3.9/convertbng
  copying convertbng/cutil.pyx -> build/lib.linux-x86_64-3.9/convertbng
  copying convertbng/liblonlat_bng.dylib -> build/lib.linux-x86_64-3.9/convertbng
  copying convertbng/liblonlat_bng.so -> build/lib.linux-x86_64-3.9/convertbng
  copying convertbng/rlib.h -> build/lib.linux-x86_64-3.9/convertbng
  running build_ext
  building 'convertbng.cutil' extension
  creating build/temp.linux-x86_64-3.9
  creating build/temp.linux-x86_64-3.9/convertbng
  gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I./convertbng -I. -Iconvertbng -I/usr/include/python3.9 -c convertbng/cutil.c -o build/temp.linux-x86_64-3.9/convertbng/cutil.o -O3
  convertbng/cutil.c: In function ‘PyInit_cutil’:
  convertbng/cutil.c:15295:93: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
  15295 |   __pyx_type_10convertbng_5cutil___pyx_scope_struct____pyx_f_10convertbng_5cutil_ffi_wrapper.tp_print = 0;
        |                                                                                             ^
  convertbng/cutil.c:15300:25: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
  15300 |   __pyx_type___pyx_array.tp_print = 0;
        |                         ^
  convertbng/cutil.c:15304:31: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
  15304 |   __pyx_type___pyx_MemviewEnum.tp_print = 0;
        |                               ^
  convertbng/cutil.c:15315:30: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
  15315 |   __pyx_type___pyx_memoryview.tp_print = 0;
        |                              ^
  convertbng/cutil.c:15324:35: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
  15324 |   __pyx_type___pyx_memoryviewslice.tp_print = 0;
        |                                   ^
  convertbng/cutil.c: In function ‘__Pyx_ParseOptionalKeywords’:
  convertbng/cutil.c:15743:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  15743 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c:15743:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  15743 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c:15743:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  15743 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c:15743:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  15743 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c:15743:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  15743 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c:15743:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  15743 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c:15759:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  15759 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c:15759:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  15759 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c:15759:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  15759 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c:15759:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  15759 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c:15759:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  15759 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c:15759:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  15759 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c: In function ‘__Pyx_CyFunction_Call’:
  convertbng/cutil.c:17096:9: warning: ‘PyCFunction_Call’ is deprecated [-Wdeprecated-declarations]
  17096 |         return PyCFunction_Call(func, arg, kw);
        |         ^~~~~~
  In file included from /usr/include/python3.9/Python.h:120,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/methodobject.h:33:43: note: declared here
     33 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
        |                                           ^~~~~~~~~~~~~~~~
  convertbng/cutil.c: In function ‘__pyx_CyFunction_init’:
  convertbng/cutil.c:17161:5: warning: ‘PyCFunction_Call’ is deprecated [-Wdeprecated-declarations]
  17161 |     __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
        |     ^~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from /usr/include/python3.9/Python.h:120,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/methodobject.h:33:43: note: declared here
     33 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
        |                                           ^~~~~~~~~~~~~~~~
  convertbng/cutil.c: In function ‘__Pyx_decode_c_string’:
  convertbng/cutil.c:17575:9: warning: ‘PyUnicode_FromUnicode’ is deprecated [-Wdeprecated-declarations]
  17575 |         return PyUnicode_FromUnicode(NULL, 0);
        |         ^~~~~~
  In file included from /usr/include/python3.9/unicodeobject.h:1026,
                   from /usr/include/python3.9/Python.h:106,
                   from convertbng/cutil.c:32:
  /usr/include/python3.9/cpython/unicodeobject.h:551:42: note: declared here
    551 | Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
        |                                          ^~~~~~~~~~~~~~~~~~~~~
  convertbng/cutil.c: In function ‘__Pyx__ExceptionSave’:
  convertbng/cutil.c:17618:21: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
  17618 |     *type = tstate->exc_type;
        |                     ^~~~~~~~
        |                     curexc_type
  convertbng/cutil.c:17619:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
  17619 |     *value = tstate->exc_value;
        |                      ^~~~~~~~~
        |                      curexc_value
  convertbng/cutil.c:17620:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
  17620 |     *tb = tstate->exc_traceback;
        |                   ^~~~~~~~~~~~~
        |                   curexc_traceback
  convertbng/cutil.c: In function ‘__Pyx__ExceptionReset’:
  convertbng/cutil.c:17627:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
  17627 |     tmp_type = tstate->exc_type;
        |                        ^~~~~~~~
        |                        curexc_type
  convertbng/cutil.c:17628:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
  17628 |     tmp_value = tstate->exc_value;
        |                         ^~~~~~~~~
        |                         curexc_value
  convertbng/cutil.c:17629:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
  17629 |     tmp_tb = tstate->exc_traceback;
        |                      ^~~~~~~~~~~~~
        |                      curexc_traceback
  convertbng/cutil.c:17630:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
  17630 |     tstate->exc_type = type;
        |             ^~~~~~~~
        |             curexc_type
  convertbng/cutil.c:17631:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
  17631 |     tstate->exc_value = value;
        |             ^~~~~~~~~
        |             curexc_value
  convertbng/cutil.c:17632:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
  17632 |     tstate->exc_traceback = tb;
        |             ^~~~~~~~~~~~~
        |             curexc_traceback
  convertbng/cutil.c: In function ‘__Pyx__GetException’:
  convertbng/cutil.c:17687:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
  17687 |     tmp_type = tstate->exc_type;
        |                        ^~~~~~~~
        |                        curexc_type
  convertbng/cutil.c:17688:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
  17688 |     tmp_value = tstate->exc_value;
        |                         ^~~~~~~~~
        |                         curexc_value
  convertbng/cutil.c:17689:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
  17689 |     tmp_tb = tstate->exc_traceback;
        |                      ^~~~~~~~~~~~~
        |                      curexc_traceback
  convertbng/cutil.c:17690:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
  17690 |     tstate->exc_type = local_type;
        |             ^~~~~~~~
        |             curexc_type
  convertbng/cutil.c:17691:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
  17691 |     tstate->exc_value = local_value;
        |             ^~~~~~~~~
        |             curexc_value
  convertbng/cutil.c:17692:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
  17692 |     tstate->exc_traceback = local_tb;
        |             ^~~~~~~~~~~~~
        |             curexc_traceback
  convertbng/cutil.c: In function ‘__Pyx__ExceptionSwap’:
  convertbng/cutil.c:17714:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
  17714 |     tmp_type = tstate->exc_type;
        |                        ^~~~~~~~
        |                        curexc_type
  convertbng/cutil.c:17715:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
  17715 |     tmp_value = tstate->exc_value;
        |                         ^~~~~~~~~
        |                         curexc_value
  convertbng/cutil.c:17716:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
  17716 |     tmp_tb = tstate->exc_traceback;
        |                      ^~~~~~~~~~~~~
        |                      curexc_traceback
  convertbng/cutil.c:17717:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
  17717 |     tstate->exc_type = *type;
        |             ^~~~~~~~
        |             curexc_type
  convertbng/cutil.c:17718:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
  17718 |     tstate->exc_value = *value;
        |             ^~~~~~~~~
        |             curexc_value
  convertbng/cutil.c:17719:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
  17719 |     tstate->exc_traceback = *tb;
        |             ^~~~~~~~~~~~~
        |             curexc_traceback
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for convertbng

Am I doing something wrong?

Load fails on Windows 10 x64

After installation when I try to import:

from convertbng.util import convert_bng
Traceback (most recent call last):
File "", line 1, in
File "C:\Python27\lib\site-packages\convertbng\util.py", line 52, in
lib = cdll.LoadLibrary(os.path.join('..', file_path, '%slonlat_bng.%s' % (prefix, ext)))
File "C:\Python27\lib\ctypes__init__.py", line 443, in LoadLibrary
return self.dlltype(name)
File "C:\Python27\lib\ctypes__init
_.py", line 365, in init
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found

Windows fails to load lonlat_bng.dll.

Windows 10 x64.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.