outlines icon indicating copy to clipboard operation
outlines copied to clipboard

Installation Issues with outlines 0.1.0 on Linux (Google Colab) and MacOS

Open hugolytics opened this issue 1 year ago • 3 comments

Describe the issue as clearly as possible:

I encountered installation issues while attempting to install the outlines package on both Linux (Google Colab) and MacOS, and they appear related to building the outlines-core component.

Steps/code to reproduce the bug:

# Using pip:
!pip install outlines

# Using poetry:
poetry add outlines

Expected result:

The outlines package should install without errors, allowing usage of the package immediately after installation.

Error message:

Linux:

Building wheels for collected packages: outlines-core
  error: subprocess-exited-with-error
  
  × Building wheel for outlines-core (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for outlines-core
Failed to build outlines-core
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (outlines-core)

Mac os:

Building wheels for collected packages: outlines-core
  error: subprocess-exited-with-error
  
  × Building wheel for outlines-core (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for outlines-core
Failed to build outlines-core
ERROR: Failed to build one or more wheels



### Outlines/Python version information:

the issue happened with the latest version of outlies (0.1.0)


### Context for the issue:

I want to try the new CFG features, however this makes it impossible to proceed.

hugolytics avatar Oct 09 '24 14:10 hugolytics

I discovered that the installation issue was due to the outlines-core package requiring a Rust compiler for certain build steps. Here’s a breakdown of the solution and relevant error messages that helped me identify the problem:

1. Rust Compiler Dependency:

The package relies on Rust to build native components, as seen in the following part of the error message:

error: can't find Rust compiler
...
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation.

2. ARM/M1 Processor Target Configuration:

While trying to install outlines-core on an Apple M1 (ARM64) processor, the process attempted to use the x86_64-apple-darwin target, which was not installed by default. The error message that pointed to this was:

error[E0463]: can't find crate for `std`
note: the `x86_64-apple-darwin` target may not be installed
help: consider downloading the target with `rustup target add x86_64-apple-darwin`

3. Resolution Steps:

To resolve the issue, I took the following steps:

  1. Installed Rust:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    

    Followed by:

    . "$HOME/.cargo/env"
    
  2. Added the x86_64-apple-darwin Target for ARM64 Compatibility: Since I'm on an Apple M1, I needed to ensure compatibility by adding the required target:

    rustup target add x86_64-apple-darwin
    
  3. Retried the Installation with poetry: Finally, running poetry add outlines succeeded with the necessary Rust environment set up.

By following these steps, the installation completed successfully. Hopefully, this helps clarify the Rust dependency for anyone encountering a similar issue!

hugolytics avatar Oct 09 '24 14:10 hugolytics

Hello I have the same issue.

Is there a way to install it, without Rust Compiler ?

etiennebonnafoux avatar Oct 10 '24 12:10 etiennebonnafoux

See #1198

richarddli avatar Oct 10 '24 12:10 richarddli

I installed rust compiler.

sudo apt  install rustc
source "$HOME/.cargo/env"

ShogoAkiyama avatar Oct 13 '24 15:10 ShogoAkiyama

Can you please try pip install git+https://github.com/lapp0/outlines@add-fsm-union-pin-core and report back whether it works? This is the branch of a PR in progress which fixes the rust installation issue.

lapp0 avatar Oct 13 '24 16:10 lapp0

您能否尝试pip install git+https://github.com/lapp0/outlines@add-fsm-union-pin-core并报告它是否有效?这是正在进行的 PR 的分支,它修复了 rust 安装问题。

我尝试了一下,还是相同的报错。

wenqilife avatar Oct 15 '24 00:10 wenqilife

@wenqilife

"I gave it a try, but the same error occurred."

Are you on Colab? If not, what OS / hardware?

lapp0 avatar Oct 15 '24 03:10 lapp0

Can you please try pip install git+https://github.com/lapp0/outlines@add-fsm-union-pin-core and report back whether it works? This is the branch of a PR in progress which fixes the rust installation issue.

This fixed the install for me on MacOS (Apple Silicon M1), thanks!

marvinschmitt avatar Oct 15 '24 08:10 marvinschmitt