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

Can't recreate a mamba environment with pixi (getting ModuleNotFoundError: No module named 'torch') #1880

Closed
2 tasks done
asmith26 opened this issue Aug 21, 2024 · 3 comments
Labels
bug Something isn't working pypi Issue related to PyPI dependencies

Comments

@asmith26
Copy link

asmith26 commented Aug 21, 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

Create a pixi.toml (I'm essentially trying to create an env for florence2):

[project]
authors = ["me <me@users.noreply.github.com>"]
channels = ["nvidia", "conda-forge"]
description = "Add a short description here"
name = "florence2"
platforms = ["linux-64"]
version = "0.1.0"

[dependencies]
python = "*"
cuda-toolkit = "*"
cuda = "*"

[pypi-dependencies]
jupyterlab = "*"
transformers = "*"
datasets = "*"
matplotlib = "*"
torch = "*"
torchvision = "*"
requests = "*"
timm = "*"
flash-attn = "*"
einops = "*"
accelerate = "*"
pillow = "*"

Then running pixi install yields:

  ⠴ default:linux-64     [00:00:03] resolving flash-attn==2.6.3                                           × failed to solve the pypi requirements of 'default' 'linux-64'
  ├─▶ failed to resolve pypi dependencies
  ├─▶ Failed to download and build `flash-attn==2.6.3`
  ├─▶ Failed to build: `flash-attn==2.6.3`
  ╰─▶ Build backend failed to determine extra requires with `build_wheel()` with exit status: 1
      --- stdout:
      
      --- stderr:
      Traceback (most recent call last):
        File "<string>", line 14, in <module>
        File "~/pixi_cache/uv-cache/environments-v0/.tmp6AntAq/lib/python3.12/site-
      packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "~/pixi_cache/uv-cache/environments-v0/.tmp6AntAq/lib/python3.12/site-
      packages/setuptools/build_meta.py", line 302, in _get_build_requires
          self.run_setup()
        File "~/pixi_cache/uv-cache/environments-v0/.tmp6AntAq/lib/python3.12/site-
      packages/setuptools/build_meta.py", line 502, in run_setup
          super().run_setup(setup_script=setup_script)
        File "~/pixi_cache/uv-cache/environments-v0/.tmp6AntAq/lib/python3.12/site-
      packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
        File "<string>", line 21, in <module>
      ModuleNotFoundError: No module named 'torch'
      ---

Issue description

Possibly related to #1834

Expected behavior

I originally created the environment with mamba and it successfully installs/runs. Here is the exported environment.yaml

name: florence2
channels:
  - nvidia
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=conda_forge
  - _openmp_mutex=4.5=2_gnu
  - _sysroot_linux-64_curr_repodata_hack=3=h69a702a_16
  - binutils_impl_linux-64=2.40=ha1999f0_7
  - binutils_linux-64=2.40=hb3c18ed_0
  - bzip2=1.0.8=h4bc722e_7
  - ca-certificates=2024.7.4=hbcca054_0
  - cuda=12.6.0=0
  - cuda-cccl=12.6.37=0
  - cuda-cccl_linux-64=12.6.37=0
  - cuda-command-line-tools=12.6.0=0
  - cuda-compiler=12.6.0=0
  - cuda-crt-dev_linux-64=12.6.20=ha770c72_0
  - cuda-crt-tools=12.6.20=ha770c72_0
  - cuda-cudart=12.6.37=0
  - cuda-cudart-dev=12.6.37=0
  - cuda-cudart-dev_linux-64=12.6.37=0
  - cuda-cudart-static=12.6.37=0
  - cuda-cudart-static_linux-64=12.6.37=0
  - cuda-cudart_linux-64=12.6.37=0
  - cuda-cuobjdump=12.6.20=0
  - cuda-cupti=12.6.37=0
  - cuda-cupti-dev=12.6.37=0
  - cuda-cuxxfilt=12.6.20=0
  - cuda-driver-dev=12.6.37=0
  - cuda-driver-dev_linux-64=12.6.37=0
  - cuda-gdb=12.6.37=0
  - cuda-libraries=12.6.0=0
  - cuda-libraries-dev=12.6.0=0
  - cuda-nsight=12.6.20=0
  - cuda-nvcc=12.6.20=0
  - cuda-nvcc-dev_linux-64=12.6.20=he91c749_0
  - cuda-nvcc-impl=12.6.20=h85509e4_0
  - cuda-nvcc-tools=12.6.20=he02047a_0
  - cuda-nvcc_linux-64=12.6.20=0
  - cuda-nvdisasm=12.6.20=0
  - cuda-nvml-dev=12.6.37=2
  - cuda-nvprof=12.6.37=0
  - cuda-nvprune=12.6.20=0
  - cuda-nvrtc=12.6.20=0
  - cuda-nvrtc-dev=12.6.20=0
  - cuda-nvtx=12.6.37=0
  - cuda-nvvm-dev_linux-64=12.6.20=ha770c72_0
  - cuda-nvvm-impl=12.6.20=he02047a_0
  - cuda-nvvm-tools=12.6.20=he02047a_0
  - cuda-nvvp=12.6.37=0
  - cuda-opencl=12.6.37=0
  - cuda-opencl-dev=12.6.37=0
  - cuda-profiler-api=12.6.37=0
  - cuda-runtime=12.6.0=0
  - cuda-sanitizer-api=12.6.34=0
  - cuda-toolkit=12.6.0=0
  - cuda-tools=12.6.0=0
  - cuda-version=12.6=3
  - cuda-visual-tools=12.6.0=0
  - gcc_impl_linux-64=13.3.0=hfea6d02_0
  - gcc_linux-64=13.3.0=hc28eda2_0
  - gds-tools=1.11.0.15=0
  - gmp=6.3.0=hac33072_2
  - gxx_impl_linux-64=13.3.0=hdbfa832_0
  - gxx_linux-64=13.3.0=h6834431_0
  - kernel-headers_linux-64=3.10.0=h4a8ded7_16
  - ld_impl_linux-64=2.40=hf3520f5_7
  - libcublas=12.6.0.22=0
  - libcublas-dev=12.6.0.22=0
  - libcufft=11.2.6.28=0
  - libcufft-dev=11.2.6.28=0
  - libcufile=1.11.0.15=0
  - libcufile-dev=1.11.0.15=0
  - libcurand=10.3.7.37=0
  - libcurand-dev=10.3.7.37=0
  - libcusolver=11.6.4.38=0
  - libcusolver-dev=11.6.4.38=0
  - libcusparse=12.5.2.23=0
  - libcusparse-dev=12.5.2.23=0
  - libexpat=2.6.2=h59595ed_0
  - libffi=3.4.2=h7f98852_5
  - libgcc-devel_linux-64=13.3.0=h84ea5a7_100
  - libgcc-ng=14.1.0=h77fa898_0
  - libgomp=14.1.0=h77fa898_0
  - libnpp=12.3.1.23=0
  - libnpp-dev=12.3.1.23=0
  - libnsl=2.0.1=hd590300_0
  - libnvfatbin=12.6.20=0
  - libnvfatbin-dev=12.6.20=0
  - libnvjitlink=12.6.20=0
  - libnvjitlink-dev=12.6.20=0
  - libnvjpeg=12.3.3.23=0
  - libnvjpeg-dev=12.3.3.23=0
  - libsanitizer=13.3.0=heb74ff8_0
  - libsqlite=3.46.0=hde9e2c9_0
  - libstdcxx-devel_linux-64=13.3.0=h84ea5a7_100
  - libstdcxx-ng=14.1.0=hc0a3c3a_0
  - libuuid=2.38.1=h0b41bf4_0
  - libxcrypt=4.4.36=hd590300_1
  - libzlib=1.3.1=h4ab18f5_1
  - ncurses=6.5=h59595ed_0
  - nsight-compute=2024.1.1.4=0
  - openssl=3.3.1=h4bc722e_2
  - pip=24.2=pyhd8ed1ab_0
  - python=3.12.5=h2ad013b_0_cpython
  - readline=8.2=h8228510_1
  - setuptools=72.2.0=pyhd8ed1ab_0
  - sysroot_linux-64=2.17=h4a8ded7_16
  - tk=8.6.13=noxft_h4845f30_101
  - wheel=0.44.0=pyhd8ed1ab_0
  - xz=5.2.6=h166bdaf_0
  - pip:
      - accelerate==0.33.0
      - aiohappyeyeballs==2.4.0
      - aiohttp==3.10.5
      - aiosignal==1.3.1
      - attrs==24.2.0
      - certifi==2024.7.4
      - charset-normalizer==3.3.2
      - datasets==2.21.0
      - dill==0.3.8
      - einops==0.8.0
      - filelock==3.15.4
      - flash-attn==2.6.3
      - frozenlist==1.4.1
      - fsspec==2024.6.1
      - huggingface-hub==0.24.6
      - idna==3.7
      - jinja2==3.1.4
      - markupsafe==2.1.5
      - mpmath==1.3.0
      - multidict==6.0.5
      - multiprocess==0.70.16
      - networkx==3.3
      - numpy==1.26.4
      - nvidia-cublas-cu12==12.1.3.1
      - nvidia-cuda-cupti-cu12==12.1.105
      - nvidia-cuda-nvrtc-cu12==12.1.105
      - nvidia-cuda-runtime-cu12==12.1.105
      - nvidia-cudnn-cu12==9.1.0.70
      - nvidia-cufft-cu12==11.0.2.54
      - nvidia-curand-cu12==10.3.2.106
      - nvidia-cusolver-cu12==11.4.5.107
      - nvidia-cusparse-cu12==12.1.0.106
      - nvidia-nccl-cu12==2.20.5
      - nvidia-nvjitlink-cu12==12.6.20
      - nvidia-nvtx-cu12==12.1.105
      - packaging==24.1
      - pandas==2.2.2
      - pillow==10.4.0
      - psutil==6.0.0
      - pyarrow==17.0.0
      - python-dateutil==2.9.0.post0
      - pytz==2024.1
      - pyyaml==6.0.2
      - regex==2024.7.24
      - requests==2.32.3
      - safetensors==0.4.4
      - six==1.16.0
      - sympy==1.13.2
      - timm==1.0.8
      - tokenizers==0.19.1
      - torch==2.4.0
      - torchvision==0.19.0
      - tqdm==4.66.5
      - transformers==4.44.1
      - triton==3.0.0
      - typing-extensions==4.12.2
      - tzdata==2024.1
      - urllib3==2.2.2
      - xxhash==3.5.0
      - yarl==1.9.4
@asmith26 asmith26 added the bug Something isn't working label Aug 21, 2024
@asmith26 asmith26 changed the title Cant' recreate a mamba environment with pixi (getting ModuleNotFoundError: No module named 'torch') Can't recreate a mamba environment with pixi (getting ModuleNotFoundError: No module named 'torch') Aug 21, 2024
@baszalmstra baszalmstra added the pypi Issue related to PyPI dependencies label Aug 22, 2024
@tdejager
Copy link
Contributor

Yes this is related to this issue, that you mentioned :)

@tdejager
Copy link
Contributor

We are in the process of getting no-build-isolation in :)

@tdejager
Copy link
Contributor

tdejager commented Sep 3, 2024

Hey we've now added build-isolation options in main: https://pixi.sh/dev/reference/project_configuration/#no-build-isolation. Should be released really soon, let me know if it works and feel free to re-open if it does not.

@tdejager tdejager closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pypi Issue related to PyPI dependencies
Projects
None yet
Development

No branches or pull requests

3 participants