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

[BUG] Python version (3.13.1) is not supported by scipy==1.9.3, which only supports Python 3.8 to 3.11. Since swarms depends on scipy, this causes the pip install swarms command to fail. #697

Open
MeltedMindz opened this issue Dec 21, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@MeltedMindz
Copy link

Bug Report: pip install swarms Fails Due to scipy Compatibility Issue

Description

When attempting to install the swarms package via pip, the installation fails during the preparation of scipy metadata. The error occurs because scipy==1.9.3 only supports Python versions 3.8 to 3.11, while the system uses Python 3.13.1.


Error Logs

Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [32 lines of output]
+ meson setup ...
../meson.build:85:2: ERROR: Problem encountered: Your Python version is too new. SciPy 1.9 supports Python 3.8-3.11; if you are trying to build from source for the most recent SciPy version you may hit this error as well. Please build from the `main` branch on GitHub instead.

Steps to Reproduce

  1. Use Python 3.13.1 (or any unsupported version above 3.11).

  2. Run the command:

    pip install swarms
  3. Observe the failure during the installation of scipy.


Suggested Solution

To resolve this issue, follow the steps below:

Solution 1: Use a Compatible Python Version

  1. Install a Supported Python Version (3.8 to 3.11):
    If using pyenv:

    pyenv install 3.11.6
  2. Set the Python Version for the Project:

    pyenv local 3.11.6
  3. Verify the Active Python Version:

    python --version
  4. Upgrade pip and Related Tools:

    pip install --upgrade pip setuptools wheel
  5. Retry Installing swarms:

    pip install swarms

Solution 2: Use Precompiled Wheels for scipy

  1. Upgrade pip:

    pip install --upgrade pip setuptools wheel
  2. Install the Latest Version of scipy:

    pip install scipy
  3. Install swarms:

    pip install swarms

Solution 3: Build scipy Manually

If necessary, build scipy manually with the required build tools:

  1. Install GCC and gfortran:

    brew install gcc
  2. Verify gfortran Installation:

    gfortran --version
  3. Retry Installing swarms:

    pip install swarms

Notes

  • The issue is caused by scipy being incompatible with Python 3.13.1. A temporary workaround is to use a compatible Python version.
  • If swarms or its dependencies can be updated to support Python 3.13, this issue may be resolved in future releases.

Environment Details

  • OS: macOS
  • Python Version: 3.13.1
  • Package: swarms
  • Dependency Causing Issue: scipy==1.9.3
@MeltedMindz MeltedMindz added the bug Something isn't working label Dec 21, 2024
Copy link

Hello there, thank you for opening an Issue ! 🙏🏻 The team was notified and they will get back to you asap.

@kyegomez
Copy link
Owner

@MeltedMindz can you please provide the full error stack trace, so i can locate the root cause of the error pls

@kyegomez
Copy link
Owner

@MeltedMindz scipy is not in the main swarms repo

@patrickbdevaney
Copy link
Contributor

patrickbdevaney commented Dec 25, 2024

Bug Report: pip install swarms Fails Due to scipy Compatibility Issue

Description

When attempting to install the swarms package via pip, the installation fails during the preparation of scipy metadata. The error occurs because scipy==1.9.3 only supports Python versions 3.8 to 3.11, while the system uses Python 3.13.1.

Error Logs

Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [32 lines of output]
+ meson setup ...
../meson.build:85:2: ERROR: Problem encountered: Your Python version is too new. SciPy 1.9 supports Python 3.8-3.11; if you are trying to build from source for the most recent SciPy version you may hit this error as well. Please build from the `main` branch on GitHub instead.

Steps to Reproduce

  1. Use Python 3.13.1 (or any unsupported version above 3.11).
  2. Run the command:
    pip install swarms
  3. Observe the failure during the installation of scipy.

Suggested Solution

To resolve this issue, follow the steps below:

Solution 1: Use a Compatible Python Version

  1. Install a Supported Python Version (3.8 to 3.11):
    If using pyenv:
    pyenv install 3.11.6
  2. Set the Python Version for the Project:
    pyenv local 3.11.6
  3. Verify the Active Python Version:
    python --version
  4. Upgrade pip and Related Tools:
    pip install --upgrade pip setuptools wheel
  5. Retry Installing swarms:
    pip install swarms

Solution 2: Use Precompiled Wheels for scipy

  1. Upgrade pip:
    pip install --upgrade pip setuptools wheel
  2. Install the Latest Version of scipy:
    pip install scipy
  3. Install swarms:
    pip install swarms

Solution 3: Build scipy Manually

If necessary, build scipy manually with the required build tools:

  1. Install GCC and gfortran:
    brew install gcc
  2. Verify gfortran Installation:
    gfortran --version
  3. Retry Installing swarms:
    pip install swarms

Notes

  • The issue is caused by scipy being incompatible with Python 3.13.1. A temporary workaround is to use a compatible Python version.
  • If swarms or its dependencies can be updated to support Python 3.13, this issue may be resolved in future releases.

Environment Details

  • OS: macOS
  • Python Version: 3.13.1
  • Package: swarms
  • Dependency Causing Issue: scipy==1.9.3

Hi @MeltedMindz, here is a method to run swarms in a python virtual environment using python 3.11

Install Python 3.12 via Homebrew:
brew install [email protected]

Create and Activate Virtual Environment:
python3.12 -m venv swarmsenv
source swarmsenv/bin/activate

Install swarms and Dependencies:
pip install swarms

Let me know if this works and if you need anymore help. In the meanwhile we will work on making swarms more accessible and compatible.

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