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

pixi init --import error invalid bracket #1901

Closed
2 tasks done
cdeil opened this issue Aug 23, 2024 · 6 comments · Fixed by #1915
Closed
2 tasks done

pixi init --import error invalid bracket #1901

cdeil opened this issue Aug 23, 2024 · 6 comments · Fixed by #1915
Labels
🐞 bug Something isn't working

Comments

@cdeil
Copy link
Contributor

cdeil commented Aug 23, 2024

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

(base) hpred $ pixi --version
pixi 0.28.0
(base) hpred $ pixi init --import ./environment-py12.yml 
  × invalid bracket

(base) hpred $ cat environment-py12.yml 
name: hpred12
channels:
  - nodefaults
  - conda-forge
dependencies:
  - python=3.12
  - pandas[performance]
  - scikit-learn
  - numpy

  - sqlalchemy
  - psycopg
  - pymssql

  # data files
  - pyarrow   # Parquet
  - openpyxl  # Excel

  # ML
  - ruptures
  - category_encoders
  - ppscore
  - dill
  - imbalanced-learn
  - scikit-lego

  # local dev
  - pre-commit # Also for CI
  - jupyterlab
  - alembic

  # viz
  - matplotlib
  - seaborn
  - bokeh
  - hiplot
  - shap
  - ipywidgets

  # Panel apps
  - panel
  - param
  - pyinstrument
  - tabulate
  - python-duckdb
  - duckdb-cli
  - click
  - nbconvert
  - missingno

  # testing
  - pytest
  - pytest-mock
  - pytest-cov
  - pytest-postgresql

  - pip
  - pip:
    # data
    - sqlalchemy-json

    # Azure
    - azure-core
    - azure-identity
    - azure-keyvault-secrets
    - azure-storage-blob
    - azure-kusto-data[pandas]  # ADX
    - opencensus-ext-azure  # Azure Application Insights

    # app
    - schedule
    - pytest-playwright

    # local DS
    - dvc[azure]

    # Panel
    - pyjwt
    - typing-extensions

Issue description

pixi init --import gives error on valid conda env file (see above)

Expected behavior

pixi init works. :-)

@cdeil cdeil added the 🐞 bug Something isn't working label Aug 23, 2024
@baszalmstra
Copy link
Contributor

The problem is with pandas[performance] which is not a valid package name because op the brackets. Conda ignores this for some reason. If you remove the [performance] part it should work.

@cdeil
Copy link
Contributor Author

cdeil commented Aug 23, 2024

Thanks!

Maybe you could ignore it as well and/or give a warning/error at least mentioning the problematic line/entry?

After I fix it I get this error which for me is also cryptic since there's no mention why the problematic package nanotime appears here, i.e. which of my dependencies try to drag it in and I have to adjust. And why the invalid gzip error?

(base) hpred $ pixi init --import environment-py12.yml
  ⠉ default:osx-arm64    [00:00:03] resolving vine==5.1.0                                                                                                           × failed to solve the pypi requirements of 'default' 'osx-arm64'
  ├─▶ failed to resolve pypi dependencies
  ├─▶ Failed to download and build `nanotime==0.5.2`
  ├─▶ Failed to install requirements from build-system.requires (install)
  ├─▶ Failed to prepare distributions
  ├─▶ Failed to fetch wheel: setuptools==72.2.0
  ├─▶ Failed to extract archive
  ╰─▶ Invalid gzip header

@akhmerov
Copy link

I start seeing "Invalid gzip header" error too, e.g. in this pipeline: https://gitlab.kwant-project.org/qt/pymablock/-/jobs/445192#L30

@akhmerov
Copy link

Removing .pixi folder and installing everything again seemingly fixed the problem 🤷‍♂️

@ruben-arts
Copy link
Contributor

The ╰─▶ Invalid gzip header issue is going to be fixed by using no-build-isolation from #1909 so fix is on it's way.

@cdeil
Copy link
Contributor Author

cdeil commented Aug 29, 2024

I still get the same error:

  ⠚ default:osx-arm64    [00:00:00] resolving nanotime==0.5.2                                                                                                                       × failed to solve the pypi requirements of 'default' 'osx-arm64'
  ├─▶ failed to resolve pypi dependencies
  ├─▶ Failed to download and build `nanotime==0.5.2`
  ├─▶ Failed to install requirements from build-system.requires (install)
  ├─▶ Failed to prepare distributions
  ├─▶ Failed to fetch wheel: setuptools==72.2.0
  ├─▶ Failed to extract archive
  ╰─▶ Invalid gzip header

The problematic package is https://pypi.org/project/dvc which for some reason pixi attempts to install https://pypi.org/project/nanotime which I think it shouldn't, or at least pip doesn't do that.

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

Successfully merging a pull request may close this issue.

4 participants