Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No module named 'packaging.metadata'" when running 1.8.3 on Mac, Linux, and Windows #101

Closed
1 task done
l0b0 opened this issue May 15, 2024 · 13 comments
Closed
1 task done
Labels
bug Something isn't working

Comments

@l0b0
Copy link

l0b0 commented May 15, 2024

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

After upgrading Poetry from 1.3.2 to 1.8.3, I'm unable to run it. Output from GitHub Actions:

Run poetry run jupyter nbconvert --debug --execute --inplace --to=notebook sentinel2_water_extraction.ipynb
  poetry run jupyter nbconvert --debug --execute --inplace --to=notebook sentinel2_water_extraction.ipynb
  shell: /usr/bin/bash --login -o errexit {0}
  env:
    GDAL_VERSION: 3.6.4
    INPUT_RUN_POST: true
    CONDA_PKGS_DIR: /home/runner/conda_pkgs_dir

No module named 'packaging.metadata'
Error: Process completed with exit code 1.

Discussion with the Poetry community.

Workaround: Upgrade to 1.7.1, which seems to be the latest non-broken version.

Installed packages

# packages in environment at /usr/share/miniconda/envs/test:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
blosc                     1.21.5               hc2324a3_1    conda-forge
brotli-python             1.1.0            py39h3d6467e_1    conda-forge
bzip2                     1.0.8                hd590300_5    conda-forge
c-ares                    1.28.1               hd590300_0    conda-forge
ca-certificates           2024.2.2             hbcca054_0    conda-forge
cachecontrol              0.14.0             pyhd8ed1ab_0    conda-forge
cachecontrol-with-filecache 0.14.0             pyhd8ed1ab_0    conda-forge
cairo                     1.18.0               h3faef2a_0    conda-forge
certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
cffi                      1.16.0           py39h7a31438_0    conda-forge
cfitsio                   4.2.0                hd9d235c_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
cleo                      2.1.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
crashtest                 0.4.1              pyhd8ed1ab_0    conda-forge
cryptography              42.0.7           py39h8169da8_0    conda-forge
dbus                      1.13.6               h5008d03_3    conda-forge
distlib                   0.3.8              pyhd8ed1ab_0    conda-forge
dulwich                   0.21.7           py39hd1e30aa_0    conda-forge
expat                     2.6.2                h59595ed_0    conda-forge
filelock                  3.14.0             pyhd8ed1ab_0    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                 h77eed37_2    conda-forge
fontconfig                2.14.2               h14ed4e7_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.12.1               h267a509_2    conda-forge
freexl                    2.0.0                h743c826_0    conda-forge
gdal                      3.6.4           py39h41b90d8_22    conda-forge
geos                      3.12.0               h59595ed_0    conda-forge
geotiff                   1.7.1               hf074850_14    conda-forge
gettext                   0.22.5               h59595ed_2    conda-forge
gettext-tools             0.22.5               h59595ed_2    conda-forge
giflib                    5.2.2                hd590300_0    conda-forge
hdf4                      4.2.15               h2a13503_7    conda-forge
hdf5                      1.14.3          nompi_h4f84152_101    conda-forge
icu                       73.2                 h59595ed_0    conda-forge
idna                      3.7                pyhd8ed1ab_0    conda-forge
importlib-metadata        7.1.0              pyha770c72_0    conda-forge
importlib_metadata        7.1.0                hd8ed1ab_0    conda-forge
jaraco.classes            3.4.0              pyhd8ed1ab_1    conda-forge
jeepney                   0.8.0              pyhd8ed1ab_0    conda-forge
json-c                    0.17                 h7ab15ed_0    conda-forge
kealib                    1.5.3                h2f55d51_0    conda-forge
keyring                   24.3.1           py39hf3d152e_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
krb5                      1.21.2               h659d440_0    conda-forge
lcms2                     2.16                 hb7c19ff_0    conda-forge
ld_impl_linux-64          2.40                 h55db66e_0    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libabseil                 20230802.1      cxx17_h59595ed_0    conda-forge
libaec                    1.1.3                h59595ed_0    conda-forge
libasprintf               0.22.5               h661eb56_2    conda-forge
libasprintf-devel         0.22.5               h661eb56_2    conda-forge
libblas                   3.9.0           22_linux64_openblas    conda-forge
libboost-headers          1.85.0               ha770c72_0    conda-forge
libcblas                  3.9.0           22_linux64_openblas    conda-forge
libcrc32c                 1.1.2                h9c3ff4c_0    conda-forge
libcurl                   8.7.1                hca28451_0    conda-forge
libdeflate                1.19                 hd590300_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libexpat                  2.6.2                h59595ed_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 13.2.0               h77fa898_7    conda-forge
libgdal                   3.6.4               hb454697_22    conda-forge
libgettextpo              0.22.5               h59595ed_2    conda-forge
libgettextpo-devel        0.22.5               h59595ed_2    conda-forge
libgfortran-ng            13.2.0               h69a702a_7    conda-forge
libgfortran5              13.2.0               hca663fb_7    conda-forge
libglib                   2.78.1               hebfc3b9_0    conda-forge
libgomp                   13.2.0               h77fa898_7    conda-forge
libgoogle-cloud           2.12.0               hef10d8f_5    conda-forge
libgrpc                   1.60.1               h74775cd_0    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
libjpeg-turbo             3.0.0                hd590300_1    conda-forge
libkml                    1.3.0             h01aab08_1018    conda-forge
liblapack                 3.9.0           22_linux64_openblas    conda-forge
libnetcdf                 4.9.2           nompi_h9612171_113    conda-forge
libnghttp2                1.58.0               h47da74e_1    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libopenblas               0.3.27          pthreads_h413a1c8_0    conda-forge
libpng                    1.6.43               h2797004_0    conda-forge
libpq                     16.3                 ha72fbe1_0    conda-forge
libprotobuf               4.25.1               hf27288f_2    conda-forge
libre2-11                 2023.09.01           h7a70373_1    conda-forge
librttopo                 1.1.0               hb58d41b_14    conda-forge
libspatialite             5.0.1               h090f1da_29    conda-forge
libsqlite                 3.45.3               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-ng              13.2.0               hc0a3c3a_7    conda-forge
libtiff                   4.6.0                ha9c0a0a_2    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libwebp-base              1.4.0                hd590300_0    conda-forge
libxcb                    1.15                 h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libxml2                   2.12.7               hc051c1a_0    conda-forge
libzip                    1.10.1               h2629f0a_3    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
minizip                   4.0.5                h0ab5242_0    conda-forge
more-itertools            10.2.0             pyhd8ed1ab_0    conda-forge
msgpack-python            1.0.8            py39h95fdab5_0    conda-forge
ncurses                   6.5                  h59595ed_0    conda-forge
nspr                      4.35                 h27087fc_0    conda-forge
nss                       3.100                hca3bf56_0    conda-forge
numpy                     1.26.4           py39h474f0d3_0    conda-forge
openjpeg                  2.5.2                h488ebb8_0    conda-forge
openssl                   3.3.0                hd590300_0    conda-forge
packaging                 24.0               pyhd8ed1ab_0    conda-forge
pcre2                     10.40                hc3806b6_0    conda-forge
pexpect                   4.9.0              pyhd8ed1ab_0    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
pixman                    0.43.2               h59595ed_0    conda-forge
pkginfo                   1.10.0             pyhd8ed1ab_0    conda-forge
platformdirs              4.2.2              pyhd8ed1ab_0    conda-forge
poetry                    1.8.3           linux_pyha804496_1    conda-forge
poetry-core               1.9.0              pyhd8ed1ab_0    conda-forge
poetry-plugin-export      1.8.0              pyhd8ed1ab_0    conda-forge
poppler                   23.10.0              h590f24d_0    conda-forge
poppler-data              0.4.12               hd8ed1ab_0    conda-forge
postgresql                16.3                 h8e811e2_0    conda-forge
proj                      9.3.0                h1d62c97_2    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pycparser                 2.22               pyhd8ed1ab_0    conda-forge
pyproject_hooks           1.1.0              pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.9.19          h0755675_0_cpython    conda-forge
python-build              1.2.1              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.19.1             pyhd8ed1ab_0    conda-forge
python-installer          0.7.0              pyhd8ed1ab_0    conda-forge
python_abi                3.9                      4_cp39    conda-forge
rapidfuzz                 3.9.0            py39h84cc369_0    conda-forge
re2                       2023.09.01           h7f4b329_1    conda-forge
readline                  8.2                  h8228510_1    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
requests-toolbelt         1.0.0              pyhd8ed1ab_0    conda-forge
secretstorage             3.3.3            py39hf3d152e_2    conda-forge
setuptools                69.5.1             pyhd8ed1ab_0    conda-forge
shellingham               1.5.4              pyhd8ed1ab_0    conda-forge
snappy                    1.2.0                hdb0a2a9_1    conda-forge
sqlite                    3.45.3               h2c6b66d_0    conda-forge
tiledb                    2.16.3               h8c794c1_3    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tomlkit                   0.12.5             pyha770c72_0    conda-forge
trove-classifiers         2024.4.10          pyhd8ed1ab_0    conda-forge
tzcode                    2024a                h3f72095_0    conda-forge
tzdata                    2024a                h0c530f3_0    conda-forge
uriparser                 0.9.8                hac33072_0    conda-forge
urllib3                   2.2.1              pyhd8ed1ab_0    conda-forge
virtualenv                20.26.2            pyhd8ed1ab_0    conda-forge
wheel                     0.43.0             pyhd8ed1ab_1    conda-forge
xerces-c                  3.2.5                hac6953d_0    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.1.1                hd590300_0    conda-forge
xorg-libsm                1.2.4                h7391055_0    conda-forge
xorg-libx11               1.8.9                h8ee46fc_0    conda-forge
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h0b41bf4_2    conda-forge
xorg-libxrender           0.9.11               hd590300_0    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h0b41bf4_1003    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
zipp                      3.17.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               hd590300_5    conda-forge
zstd                      1.5.6                ha6fb4c9_0    conda-forge

Environment info

active environment : test
    active env location : /usr/share/miniconda/envs/test
            shell level : 2
       user config file : /home/runner/.condarc
 populated config files : /home/runner/.condarc
          conda version : 24.3.0
    conda-build version : not installed
         python version : 3.12.2.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=zen2
                          __conda=24.3.0=0
                          __glibc=2.35=0
                          __linux=6.5.0=0
                          __unix=0=0
       base environment : /usr/share/miniconda  (writable)
      conda av data dir : /usr/share/miniconda/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/runner/conda_pkgs_dir
       envs directories : /usr/share/miniconda/envs
                          /home/runner/.conda/envs
               platform : linux-64
             user-agent : conda/24.3.0 requests/2.31.0 CPython/3.12.2 Linux/6.5.0-1021-azure ubuntu/22.04.4 glibc/2.35 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.8 aau/0.4.4 c/. s/. e/.
                UID:GID : 1001:127
             netrc file : None
           offline mode : False
@l0b0 l0b0 added the bug Something isn't working label May 15, 2024
@xylar
Copy link
Contributor

xylar commented May 16, 2024

@l0b0, I appreciate you reporting this. Yours seems like a complicated case!

Looking at your CI, it seems like you first create a conda environment, and then install gdal and poetry:
https://github.com/linz/emergency-management-tools/blob/master/.github/workflows/test.yml#L157-L158
So far, so good, and I suspect that is the environment you reported above.

But then you install a bunch of packages from your poetry lock file:
https://github.com/linz/emergency-management-tools/blob/master/.github/workflows/test.yml#L161

This results in mixing a bunch of packages from conda-forge with a bunch from PyPI, which is typically not something that works well. The result is some downgrades and presumably a bunch of reinstalls:

...
  - Downgrading packaging (24.0 /home/conda/feedstock_root/build_artifacts/packaging_1710075952259/work -> 23.0)
...

We would probably need to see the output of conda list after that process has completed, but I suspect it would be a frankenstein of packages from conda-forge and PyPI, which is not something we can support or help you very much with. I suppose it's somewhere in there that a version of packaging gets installed that doesn't have packaging.metadata. We have a constraint here:

- packaging >=23.1

so if this had been a pure conda environment, we would not have let this downgrade occur. But we can't control what PyPI packages you install into a conda environment.

It seems like your workflow would be more compatible with starting with a very simple conda environment (e.g. just with python and pip) and installing all of your dependencies from PyPI. Importantly, it seems like you should install poetry itself from PyPI. Are you using conda-forge primarily to get gdal? If so, I think your mix of conda-forge and PyPI packages will bite you in the butt sooner or later even if you get you CI to work.

I'm happy to help where I can but I don't think this is a conda-forge problem (or a poetry problem or a PyPI problem) but an issue of mixing packages from different distributions.

@l0b0
Copy link
Author

l0b0 commented May 16, 2024

Thank you very much for your thorough response, @xylar! Some background:

(tl;dr: If this can't be done easily and reliably with Conda I'll have to use platform-specific package managers find some other way to install GDAL.)

  • The end users are non-developers on a mix of Linux, Mac, and Windows systems.
  • Time is of the essence when this software is needed.

This has resulted in the following decisions:

  • Test the oldest and newest Python versions, since it's difficult to upgrade it or to install multiple versions on most platforms.
  • Test popular versions of each of the target platforms.
  • (Earlier on it was decided that the cost of testing every supported version of every Python version and OS would make the matrix too big, hence the limitations above.)
  • Additionally test on Nix, because it has a good track record of reproducibility.
  • Avoid duplication of configuration and code between the platforms, to keep maintenance easy and the software reliable.
  • Lock all the versions I can control, so that users are less likely to run into problems because of version drift.

Some observations have also played into this (some of them may be wrong or outdated; I'd welcome constructive feedback):

  • GDAL is difficult to build and install. See for example its nixpkgs declaration.
  • Conda is the only package manager I'm aware of which can install GDAL on all the target platforms.
  • GDAL recommends installing using Conda
  • If I understand correctly, Conda doesn't really support cross-platform environment configuration.
  • OS package managers are generally very slow to make newer versions of packages like GDAL available, so using them will make keeping versions in sync even more of a challenge.

Together, these mean that Conda is the only obvious choice to install GDAL. However

  • Looking into a bunch of broken builds, poetry install randomly breaks because of missing files which look related to Conda:
    • "No such file or directory: '/usr/local/miniconda/envs/test/lib/python3.8/site-packages/jsonschema-4.21.1.dist-info'"
    • "No such file or directory: '/usr/share/miniconda/envs/test/lib/python3.8/site-packages/~equests-2.31.0.dist-info'"
    • "No such file or directory: '/usr/local/miniconda/envs/test/lib/python3.8/site-packages/~dna-3.7.dist-info'"
    • "No such file or directory: '/usr/share/miniconda/envs/test/lib/python3.8/site-packages/~ttrs-23.2.0.dist-info'"
  • Conda does not support installing arbitrary PyPI packages, and it would take me far too much time to package all of the dependencies.
  • Nix does not support wrapping Conda environments.

The result is that I want to use Conda to install GDAL, but also that I want to use some other solution to install all the other packages. Pip is missing many useful features of modern package managers (locking using hashes by default, separating top-level and transitive dependencies, and separating development and production dependencies are just the biggest gripes), so that's out. I know Poetry reasonably well, and there's poetry2nix to avoid the need to reconfigure anything to install Python packages using Nix.

@xylar
Copy link
Contributor

xylar commented May 16, 2024

@l0b0, do you think you would have more luck if you install only GDAL from conda but poetry from PyPI (with pip)?

I use conda-forge almost exclusively so I don't have a lot of personal experience on when mixing conda-forge and PyPI packages breaks and when it works, but we get a lot of complaints from users who try to mix packages between the two. I think if you do continue to mix packages from both, you're going to have to take responsibility for debugging things that go wrong because I don't think either the folks that release their packages on PyPI nor conda-forge maintainers are interested in figuring out how to make a hybrid work.

I think the trouble you are running into with poetry install and your various "No such file or directory" errors are also related to poetry installing (or attempting to uninstall) packages in the PyPI way, not the conda way. That's just a hunch.

I don't know anything about Nix.

You said that conda environments too often don't work reliably. That can certainly happen as packages get marked as broken. I think it's substantially rarer than it used to be but I can't say from experience how that might compare with PyPI. GDAL has an especially complicated and fragile dependency chain so that may be a package that, together with other dependencies, could become challenging.

You said that too many of your dependencies aren't available on conda-forge. I would be willing to help get them built on conda-forge if you think that could become a feasible path forward. It would be important to know how many packages we're talking about and how many are pure python vs. something more complicated.

l0b0 added a commit to linz/emergency-management-tools that referenced this issue May 16, 2024
l0b0 added a commit to linz/emergency-management-tools that referenced this issue May 16, 2024
l0b0 added a commit to linz/emergency-management-tools that referenced this issue May 16, 2024
As [recommended by the documentation](https://python-poetry.org/docs/#ci-recommendations) and
[@xylar](conda-forge/poetry-feedstock#101 (comment)).
This should avoid the "No such file or directory:
'/usr/local/miniconda/envs/test/lib/python3.[…]/site-packages/[…].dist-info'"
errors which probably comes from the interaction between Conda and Poetry.
@l0b0
Copy link
Author

l0b0 commented May 16, 2024

Thank you very much for your help, @xylar!

I think the trouble you are running into with poetry install and your various "No such file or directory" errors are also related to poetry installing (or attempting to uninstall) packages in the PyPI way, not the conda way. That's just a hunch.

It's possible. I'm pretty sure I've only seen this issue when using Poetry with Conda, though.

You said that too many of your dependencies aren't available on conda-forge. I would be willing to help get them built on conda-forge if you think that could become a feasible path forward. It would be important to know how many packages we're talking about and how many are pure python vs. something more complicated.

That would be everything in the two poetry.lock files (1, 2):

grep --no-filename --only-matching --perl-regexp '(?<=^name = ")[^"]+' flooding/sentinel*_water_extraction/poetry.lock | sort -u
affine
annotated-types
anyio
appnope
argon2-cffi
argon2-cffi-bindings
arrow
asttokens
async-lru
attrs
babel
backcall
beautifulsoup4
bleach
cachetools
certifi
cffi
charset-normalizer
click
click-plugins
cligj
colorama
color-operations
comm
contourpy
cycler
debugpy
decorator
defusedxml
entrypoints
executing
fastjsonschema
fiona
fonttools
fqdn
gdal
geopandas
h11
httpcore
httpx
idna
importlib-metadata
importlib-resources
ipykernel
ipython
ipython-genutils
ipywidgets
isoduration
jedi
jinja2
json5
jsonpointer
jsonschema
jsonschema-specifications
jupyter
jupyter-client
jupyter-console
jupyter-core
jupyter-events
jupyterlab
jupyterlab-pygments
jupyterlab-server
jupyterlab-widgets
jupyter-lsp
jupyter-server
jupyter-server-terminals
kiwisolver
markupsafe
matplotlib
matplotlib-inline
mistune
morecantile
munch
nbclassic
nbclient
nbconvert
nbformat
nest-asyncio
notebook
notebook-shim
numexpr
numpy
overrides
packaging
pandas
pandocfilters
parso
pexpect
pickleshare
pillow
platformdirs
prometheus-client
prompt-toolkit
psutil
ptyprocess
pure-eval
pycparser
pydantic
pydantic-core
pygments
pyparsing
pyproj
pyrsistent
pystac
python-dateutil
python-json-logger
pytz
pywin32
pywinpty
pyyaml
pyzmq
qtconsole
qtpy
rasterio
referencing
requests
rfc3339-validator
rfc3986
rfc3986-validator
rio-tiler
rpds-py
sat-search
sat-stac
send2trash
setuptools
shapely
six
sniffio
snuggs
soupsieve
stack-data
terminado
tinycss2
tomli
tornado
traitlets
typing-extensions
uri-template
urllib3
wcwidth
webcolors
webencodings
websocket-client
widgetsnbextension
zipp

@xylar
Copy link
Contributor

xylar commented May 16, 2024

Oof, that’s a lot!

@l0b0
Copy link
Author

l0b0 commented May 16, 2024

Not really, it's one of the smallest dependency Python chains I've dealt with. These are the top-level packages:

grep -F --no-filename '= "*"' flooding/sentinel*_water_extraction/pyproject.toml | cut -d ' ' -f1 | sort -u
gdal
geopandas
jupyter
jupyterlab
matplotlib
rio-tiler
sat-search
shapely

Basically, if these could all be installed with Conda, including all their dependencies, that would add up to the 200+ packages in my previous comment.

@xylar
Copy link
Contributor

xylar commented May 16, 2024

Oh, much more manageabe!

I’ll see what I can do.

@xylar
Copy link
Contributor

xylar commented May 16, 2024

I’m guessing these are missing?

rio-tiler
sat-search

@l0b0
Copy link
Author

l0b0 commented May 16, 2024

I’m guessing these are missing?

rio-tiler sat-search

I haven't looked into what's missing; I always assumed it was going to be an unsustainable amount of work.

Also, please don't feel obliged to work on any of this! I don't even know whether a full Conda solution would be preferable to the current one.

@BastianZim
Copy link
Member

gdal
geopandas
jupyter
jupyterlab
matplotlib
rio-tiler
sat-search
shapely

All of these are available on conda-forge: https://conda-forge.org/packages/

@xylar
Copy link
Contributor

xylar commented May 17, 2024

@l0b0 can you see what goes wrong when you try to install everything from conda-forge? I'm happy to debug incompatibilities and try to make your installation from conda-forge more robust. It should be possible to use yaml files to install very specific environments (either with specific versions of packages pinned, down to the build hash or with tight constraints on version ranges), similar to your lock files. I suspect unless you get all packages either from PyPI or from conda-forge that things will never be completely robust. I realize that the nix question remains.

@l0b0
Copy link
Author

l0b0 commented May 17, 2024

@l0b0 can you see what goes wrong when you try to install everything from conda-forge? I'm happy to debug incompatibilities and try to make your installation from conda-forge more robust.

Sincere thanks for that! I'm sorry to say I don't think I will spend time on this right now, based on issues mentioned below.

It should be possible to use yaml files to install very specific environments (either with specific versions of packages pinned, down to the build hash or with tight constraints on version ranges), similar to your lock files.

It would need at least these features of Poetry:

  • Cross-platform without any extra manual work.
  • Trivial process to generate cross-platform lock file from the manual configuration.
  • Hashed dependencies.
  • Everything locked to a single version.
  • Dependencies upgradeable individually or en masse.

I suspect unless you get all packages either from PyPI or from conda-forge that things will never be completely robust.

I think I do?

I realize that the nix question remains.

I could easily live without Nix support if Conda gave some other advantages over the current setup.

Another issue is that Dependabot does not support Conda, so future version upgrades would be manual.

@l0b0 l0b0 closed this as completed May 17, 2024
@xylar
Copy link
Contributor

xylar commented May 17, 2024

@l0b0, I'm glad you have something that works at least.

l0b0 added a commit to linz/emergency-management-tools that referenced this issue May 22, 2024
As [recommended by the documentation](https://python-poetry.org/docs/#ci-recommendations) and
[@xylar](conda-forge/poetry-feedstock#101 (comment)).
This should avoid the "No such file or directory:
'/usr/local/miniconda/envs/test/lib/python3.[…]/site-packages/[…].dist-info'"
errors which probably comes from the interaction between Conda and Poetry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants