outlines
outlines copied to clipboard
Installation Issues with outlines 0.1.0 on Linux (Google Colab) and MacOS
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.
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:
-
Installed Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shFollowed by:
. "$HOME/.cargo/env" -
Added the
x86_64-apple-darwinTarget 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 -
Retried the Installation with
poetry: Finally, runningpoetry add outlinessucceeded 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!
Hello I have the same issue.
Is there a way to install it, without Rust Compiler ?
See #1198
I installed rust compiler.
sudo apt install rustc
source "$HOME/.cargo/env"
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.
您能否尝试
pip install git+https://github.com/lapp0/outlines@add-fsm-union-pin-core并报告它是否有效?这是正在进行的 PR 的分支,它修复了 rust 安装问题。
我尝试了一下,还是相同的报错。
@wenqilife
"I gave it a try, but the same error occurred."
Are you on Colab? If not, what OS / hardware?
Can you please try
pip install git+https://github.com/lapp0/outlines@add-fsm-union-pin-coreand 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!