cartopy icon indicating copy to clipboard operation
cartopy copied to clipboard

Contribution instructions not working on Windows

Open letmaik opened this issue 3 years ago • 4 comments
trafficstars

Description

This refers to https://github.com/SciTools/cartopy/blob/master/docs/source/contribute.rst.

Running pip install -e . after setting up the conda env fails during building of the Cython module with:

"geos_c.h": No such file or directory

@greglucas

Full environment definition

Operating system

Windows 10

Cartopy version

master (e55b9a21f4d58ef8db42299dfddedf8775f4fd13)

conda list

# Name                    Version                   Build  Channel
alabaster                 0.7.12                     py_0    conda-forge
atomicwrites              1.4.0              pyh9f0ad1d_0    conda-forge
attrs                     21.2.0             pyhd8ed1ab_0    conda-forge
babel                     2.9.1              pyh44b312d_0    conda-forge
beautifulsoup4            4.10.0             pyha770c72_0    conda-forge
blosc                     1.21.0               h0e60522_0    conda-forge
boost-cpp                 1.74.0               h5b4e17d_5    conda-forge
brotli                    1.0.9                h8ffe710_6    conda-forge
brotli-bin                1.0.9                h8ffe710_6    conda-forge
brotlipy                  0.7.0           py39hb82d6ee_1003    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
ca-certificates           2021.10.8            h5b45459_0    conda-forge
cairo                     1.16.0            h15b3021_1009    conda-forge
certifi                   2021.10.8        py39hcbf5309_1    conda-forge
cffi                      1.15.0           py39h0878f49_0    conda-forge
cfitsio                   4.0.0                hd67004f_0    conda-forge
chardet                   4.0.0            py39hcbf5309_2    conda-forge
charset-normalizer        2.0.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
cryptography              35.0.0           py39h7bc7c5c_2    conda-forge
curl                      7.80.0               h789b8ee_0    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
cython                    0.29.24          py39h415ef7b_1    conda-forge
docutils                  0.17.1           py39hcbf5309_1    conda-forge
execnet                   1.9.0              pyhd8ed1ab_0    conda-forge
expat                     2.4.1                h39d44d4_0    conda-forge
flake8                    4.0.1              pyhd8ed1ab_1    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.13.1            h1989441_1005    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.28.1           py39hb82d6ee_0    conda-forge
freetype                  2.10.4               h546665d_1    conda-forge
freexl                    1.0.6                ha8e266a_0    conda-forge
gdal                      3.4.0            py39h3f5efd6_6    conda-forge
geos                      3.10.1               h39d44d4_1    conda-forge
geotiff                   1.7.0                hc8731e1_5    conda-forge
gettext                   0.19.8.1          ha2e2712_1008    conda-forge
hdf4                      4.2.15               h0e5069d_3    conda-forge
hdf5                      1.12.1          nompi_h2a0e4a3_101    conda-forge
icu                       69.1                 h0e60522_0    conda-forge
idna                      3.1                pyhd3deb0d_0    conda-forge
imagesize                 1.3.0              pyhd8ed1ab_0    conda-forge
importlib-metadata        4.2.0            py39hcbf5309_0    conda-forge
iniconfig                 1.1.1              pyh9f0ad1d_0    conda-forge
intel-openmp              2021.4.0          h57928b3_3556    conda-forge
jbig                      2.1               h8d14728_2003    conda-forge
jinja2                    3.0.3              pyhd8ed1ab_0    conda-forge
jpeg                      9d                   h8ffe710_0    conda-forge
kealib                    1.4.14               h8995ca9_3    conda-forge
kiwisolver                1.3.2            py39h2e07f2f_1    conda-forge
krb5                      1.19.2               h20d022d_3    conda-forge
lcms2                     2.12                 h2a16943_0    conda-forge
lerc                      3.0                  h0e60522_0    conda-forge
libblas                   3.9.0              12_win64_mkl    conda-forge
libbrotlicommon           1.0.9                h8ffe710_6    conda-forge
libbrotlidec              1.0.9                h8ffe710_6    conda-forge
libbrotlienc              1.0.9                h8ffe710_6    conda-forge
libcblas                  3.9.0              12_win64_mkl    conda-forge
libcurl                   7.80.0               h789b8ee_0    conda-forge
libdeflate                1.8                  h8ffe710_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libgdal                   3.4.0                h06381fc_6    conda-forge
libglib                   2.70.1               h3be07f2_0    conda-forge
libiconv                  1.16                 he774522_0    conda-forge
libkml                    1.3.0             h9859afa_1014    conda-forge
liblapack                 3.9.0              12_win64_mkl    conda-forge
libnetcdf                 4.8.1           nompi_h1cc8e9d_101    conda-forge
libpng                    1.6.37               h1d00b33_2    conda-forge
libpq                     13.3                 hfcc5ef8_3    conda-forge
librttopo                 1.1.0                he35e8ac_8    conda-forge
libspatialite             5.0.1               hf126459_12    conda-forge
libssh2                   1.10.0               h680486a_2    conda-forge
libtiff                   4.3.0                hd413186_2    conda-forge
libwebp-base              1.2.1                h8ffe710_0    conda-forge
libxml2                   2.9.12               hf5bbc77_1    conda-forge
libzip                    1.8.0                hfed4ece_1    conda-forge
libzlib                   1.2.11            h8ffe710_1013    conda-forge
lz4-c                     1.9.3                h8ffe710_1    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6    conda-forge
m2w64-gcc-libs            5.3.0                         7    conda-forge
m2w64-gcc-libs-core       5.3.0                         7    conda-forge
m2w64-gmp                 6.1.0                         2    conda-forge
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    conda-forge
markupsafe                2.0.1            py39hb82d6ee_1    conda-forge
matplotlib-base           3.5.0           py39h27bb5c7_200    conda-forge/label/testing
mccabe                    0.6.1                      py_1    conda-forge
mkl                       2021.4.0           h0e2418a_729    conda-forge
more-itertools            8.11.0             pyhd8ed1ab_0    conda-forge
msys2-conda-epoch         20160418                      1    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
numpy                     1.21.4           py39h6635163_0    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openjpeg                  2.4.0                hb211442_1    conda-forge
openssl                   1.1.1l               h8ffe710_0    conda-forge
owslib                    0.25.0             pyhd8ed1ab_0    conda-forge
packaging                 21.3               pyhd8ed1ab_0    conda-forge
pcre                      8.45                 h0e60522_0    conda-forge
pillow                    8.4.0            py39h916092e_0    conda-forge
pip                       21.3.1             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h8ffe710_0    conda-forge
pluggy                    1.0.0            py39hcbf5309_2    conda-forge
poppler                   21.11.0              h24fffdf_0    conda-forge
poppler-data              0.4.11               hd8ed1ab_0    conda-forge
postgresql                13.3                 h1c22c4f_3    conda-forge
proj                      8.2.0                h1cfcee9_0    conda-forge
py                        1.11.0             pyh6c4a22f_0    conda-forge
pycodestyle               2.8.0              pyhd8ed1ab_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pydata-sphinx-theme       0.7.2              pyhd8ed1ab_0    conda-forge
pyflakes                  2.4.0              pyhd8ed1ab_0    conda-forge
pygments                  2.10.0             pyhd8ed1ab_0    conda-forge
pykdtree                  1.3.4            py39h5d4886f_1    conda-forge
pyopenssl                 21.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.6              pyhd8ed1ab_0    conda-forge
pyproj                    3.3.0            py39h312c5a8_0    conda-forge
pyshp                     2.1.3              pyh44b312d_0    conda-forge
pysocks                   1.7.1            py39hcbf5309_4    conda-forge
pytest                    6.2.5            py39hcbf5309_1    conda-forge
pytest-forked             1.3.0              pyhd3deb0d_0    conda-forge
pytest-mpl                0.13               pyhd8ed1ab_0    conda-forge
pytest-xdist              2.4.0              pyhd8ed1ab_0    conda-forge
python                    3.9.7           h7840368_3_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pytz                      2021.3             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0              py39hb82d6ee_3    conda-forge
requests                  2.26.0             pyhd8ed1ab_0    conda-forge
scipy                     1.7.2            py39hc0c34ad_0    conda-forge
setuptools                59.2.0           py39hcbf5309_0    conda-forge
setuptools-scm            6.3.2              pyhd8ed1ab_0    conda-forge
setuptools_scm            6.3.2                hd8ed1ab_0    conda-forge
setuptools_scm_git_archive 1.1                        py_0    conda-forge
shapely                   1.8.0            py39h1db6edd_4    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snowballstemmer           2.2.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.3                pyhd8ed1ab_0    conda-forge
sphinx                    4.3.0              pyh6c4a22f_0    conda-forge
sphinx-gallery            0.10.1             pyhd8ed1ab_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    2.0.0              pyhd8ed1ab_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.5              pyhd8ed1ab_1    conda-forge
sqlite                    3.36.0               h8ffe710_2    conda-forge
tbb                       2021.4.0             h2d74725_1    conda-forge
tiledb                    2.3.4                h78dabda_0    conda-forge
tk                        8.6.11               h8ffe710_1    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     1.2.2              pyhd8ed1ab_0    conda-forge
tzdata                    2021e                he74cb21_0    conda-forge
ucrt                      10.0.20348.0         h57928b3_0    conda-forge
urllib3                   1.26.7             pyhd8ed1ab_0    conda-forge
vc                        14.2                 hb210afc_5    conda-forge
vs2015_runtime            14.29.30037          h902a5da_5    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
win_inet_pton             1.1.0            py39hcbf5309_3    conda-forge
xerces-c                  3.2.3                h0e60522_4    conda-forge
xz                        5.2.5                h62dcd97_1    conda-forge
yaml                      0.2.5                he774522_0    conda-forge
zipp                      3.6.0              pyhd8ed1ab_0    conda-forge
zlib                      1.2.11            h8ffe710_1013    conda-forge
zstd                      1.5.0                h6255e5f_0    conda-forge

pip list

Package                       Version
----------------------------- ---------
alabaster                     0.7.12
atomicwrites                  1.4.0
attrs                         21.2.0
Babel                         2.9.1
beautifulsoup4                4.10.0
brotlipy                      0.7.0
certifi                       2021.10.8
cffi                          1.15.0
chardet                       4.0.0
charset-normalizer            2.0.0
colorama                      0.4.4
cryptography                  35.0.0
cycler                        0.11.0
Cython                        0.29.24
docutils                      0.17.1
execnet                       1.9.0
flake8                        4.0.1
fonttools                     4.28.1
GDAL                          3.4.0
idna                          3.1
imagesize                     1.3.0
importlib-metadata            4.2.0
iniconfig                     1.1.1
Jinja2                        3.0.3
kiwisolver                    1.3.2
MarkupSafe                    2.0.1
matplotlib                    3.5.0
mccabe                        0.6.1
more-itertools                8.11.0
munkres                       1.1.4
numpy                         1.21.4
olefile                       0.46
OWSLib                        0.25.0
packaging                     21.3
Pillow                        8.4.0
pip                           21.3.1
pluggy                        1.0.0
py                            1.11.0
pycodestyle                   2.8.0
pycparser                     2.21
pydata-sphinx-theme           0.7.2
pyflakes                      2.4.0
Pygments                      2.10.0
pykdtree                      1.3.4
pyOpenSSL                     21.0.0
pyparsing                     3.0.6
pyproj                        3.3.0
pyshp                         2.1.3
PySocks                       1.7.1
pytest                        6.2.5
pytest-forked                 1.3.0
pytest-mpl                    0.13
pytest-xdist                  2.4.0
python-dateutil               2.8.2
pytz                          2021.3
PyYAML                        6.0
requests                      2.26.0
scipy                         1.7.2
setuptools                    59.2.0
setuptools-scm                6.3.2
setuptools-scm-git-archive    1.1
Shapely                       1.8.0
six                           1.16.0
snowballstemmer               2.2.0
soupsieve                     2.3
Sphinx                        4.3.0
sphinx-gallery                0.10.1
sphinxcontrib-applehelp       1.0.2
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
toml                          0.10.2
tomli                         1.2.2
urllib3                       1.26.7
wheel                         0.37.0
win-inet-pton                 1.1.0
zipp                          3.6.0

letmaik avatar Nov 21 '21 15:11 letmaik

It looks like you have geos installed... Just to be sure, you did activate the environment when pip installing?

This is the conda installation procedure, so perhaps check that your library paths are correct? https://github.com/conda-forge/cartopy-feedstock/blob/master/recipe/bld.bat

It looks like there used to be a copy of "geos_c.h" over to "geos.h" on Windows, but I don't see that happening anymore. https://stackoverflow.com/questions/45276861/pip-install-global-option-l-library-path-option-l-not-recongnised

Unfortunately, I don't have a Windows machine to test it out on, so all I can suggest is looking at the potential library paths and trying to find out what your geos header file is called and where it is located. if you figure out that we need to update the installation procedures for windows, a PR with that fix would be very welcome!

greglucas avatar Nov 22 '21 19:11 greglucas

It looks like you have geos installed... Just to be sure, you did activate the environment when pip installing?

Yes, it was activated.

letmaik avatar Nov 23 '21 08:11 letmaik

I just saw that before the error there's a warning:

...\cartopy\setup.py:117: UserWarning: Unable to determine GEOS version. Ensure you have 3.7.2 or later installed, or installation may fail.

letmaik avatar Nov 23 '21 09:11 letmaik

You have geos 3.10.1 installed according to your environment though! geos 3.10.1 h39d44d4_1 conda-forge So, somehow the system isn't finding that library that you already have.

Look for these paths and what they are set to when you have activated your environment. The location of the geos libraries needs to be added to these paths if it isn't already there.

set LIB=%LIBRARY_LIB%;%LIB%
set LIBPATH=%LIBRARY_LIB%;%LIBPATH%
set INCLUDE=%LIBRARY_INC%;%INCLUDE%
set FORCE_CYTHON=1

greglucas avatar Nov 23 '21 14:11 greglucas

We have just released v0.22 which should help with the compatibility between packages and installation much easier. Please open a new issue if you are still having problems.

greglucas avatar Aug 05 '23 02:08 greglucas