exo icon indicating copy to clipboard operation
exo copied to clipboard

explicitly setting python version to 3.12

Open cadenmackenzie opened this issue 1 year ago • 4 comments

As stated in the README you must use Python>=3.12.0 however I was not able to create a venv and install the packages with version Python 3.13.0. I had to explicitly set the version to 3.12 to create a successful venv.

Is this a valid solution for now or is it worth trying to fix the issues with 3.13?

I am using a Mac M1. I can create the issue I was experiencing with 3.13 if needed.

cadenmackenzie avatar Nov 12 '24 22:11 cadenmackenzie

Added issue with some logs: https://github.com/exo-explore/exo/issues/446

cadenmackenzie avatar Nov 12 '24 22:11 cadenmackenzie

+1 on this. This will help alleviate a lot of confusion since at this point the repo only really works in 3.12. I have a recommend change though. How about adding:

if command -v python3.12 &>/dev/null; then
    echo "Python 3.12 is installed, proceeding..."
else
    echo "This repo currently only works with Python 3.12, which is not installed on your machine. Please install Python 3.12 and try again."
    exit 1
fi

dtnewman avatar Nov 13 '24 15:11 dtnewman

@dtnewman great suggestion. Added to install.sh

cadenmackenzie avatar Nov 14 '24 21:11 cadenmackenzie

@AlexCheema this came up in the help channel yesterday.

Screenshot 2024-11-21 at 7 41 49 AM

worth merging in?

cadenmackenzie avatar Nov 21 '24 15:11 cadenmackenzie

Should not be necessary after https://github.com/exo-explore/exo/commit/2dafa9cc6538648f8a00352045fcefd163e32408 This makes EXO compatible with Python 3.9,3.10,3.11,3.12,3.13. Still leaving the requirement for Python >= 3.12 in the README for now.

Closing for now. Can you test that it works now with earlier version of Python? @cadenmackenzie If not, please re-open.

AlexCheema avatar Nov 23 '24 19:11 AlexCheema

@AlexCheema I am still getting an error when I use my default python version (3.13) and try to run source install.sh

Building wheel for sentencepiece (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for sentencepiece (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [109 lines of output] /private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-sk4mu2lk/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite' warnings.warn(msg) ...

File "", line 87, in build_extension File "/opt/homebrew/Cellar/[email protected]/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 419, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['./build_bundled.sh', '0.2.0']' returned non-zero exit status 127. [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for sentencepiece Successfully built exo nuitka tinygrad Failed to build sentencepiece

[notice] A new release of pip is available: 24.2 -> 24.3.1 [notice] To update, run: pip install --upgrade pip ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (sentencepiece) (.venv) cadenmackenzie@Caden-Macbook-Pro-14 exo % exo zsh: command not found: exo (.venv) cadenmackenzie@Caden-Macbook-Pro-14 exo % python --version Python 3.13.0

Different error than I was getting before but still not working

cadenmackenzie avatar Nov 24 '24 01:11 cadenmackenzie

Did you try upgrading pip as instructed in the message?

AlexCheema avatar Nov 25 '24 18:11 AlexCheema

@AlexCheema yes, still getting the error:

cadenmackenzie@Caden-Macbook-Pro-14 exo % python3 --version Python 3.13.0 cadenmackenzie@Caden-Macbook-Pro-14 exo % source install.sh ... Installing build dependencies ... done Checking if build backend supports build_editable ... done Getting requirements to build editable ... done Preparing editable metadata (pyproject.toml) ... done Collecting tinygrad@ git+https://github.com/tinygrad/tinygrad.git@3b26e51fcebfc6576f4e0f99693e6f1406d61d79 (from exo==0.0.1) Using cached tinygrad-0.10.0-py3-none-any.whl Collecting aiohttp==3.10.11 (from exo==0.0.1) ... Building wheels for collected packages: exo, sentencepiece Building editable for exo (pyproject.toml) ... done Created wheel for exo: filename=exo-0.0.1-0.editable-py3-none-any.whl size=15497 sha256=aa9cc092ccc4ce700dc8c3685981a08f0dd35b8acd19636ae22fedff4ddc5e66 Stored in directory: /private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-ephem-wheel-cache-q37fm_yr/wheels/2d/d5/ca/28701ccb455f52034a0510efc039d1f34787ce599fa8263435 Building wheel for sentencepiece (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for sentencepiece (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [109 lines of output] /private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-bie1ocyq/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite' warnings.warn(msg) running bdist_wheel running build running build_py creating build/lib.macosx-15.0-arm64-cpython-313/sentencepiece copying src/sentencepiece/init.py -> build/lib.macosx-15.0-arm64-cpython-313/sentencepiece copying src/sentencepiece/_version.py -> build/lib.macosx-15.0-arm64-cpython-313/sentencepiece copying src/sentencepiece/sentencepiece_model_pb2.py -> build/lib.macosx-15.0-arm64-cpython-313/sentencepiece copying src/sentencepiece/sentencepiece_pb2.py -> build/lib.macosx-15.0-arm64-cpython-313/sentencepiece running build_ext Package sentencepiece was not found in the pkg-config search path. Perhaps you should add the directory containing `sentencepiece.pc' to the PKG_CONFIG_PATH environment variable Package 'sentencepiece' not found ./build_bundled.sh: line 21: cmake: command not found ./build_bundled.sh: line 22: nproc: command not found ./build_bundled.sh: line 22: cmake: command not found Traceback (most recent call last): ... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ metadata_directory) ^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-bie1ocyq/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 438, in build_wheel return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)]) File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-bie1ocyq/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 426, in _build return self._build_with_temp_dir( ~~~~~~~~~~~~~~~~~~~~~~~~~^ cmd, ^^^^ ...<3 lines>... self._arbitrary_args(config_settings), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ ... File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-bie1ocyq/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 476, in build_extensions self._build_extensions_serial() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-bie1ocyq/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 502, in _build_extensions_serial self.build_extension(ext) ~~~~~~~~~~~~~~~~~~~~^^^^^ File "", line 87, in build_extension File "/opt/homebrew/Cellar/[email protected]/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 419, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['./build_bundled.sh', '0.2.0']' returned non-zero exit status 127. [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for sentencepiece Successfully built exo Failed to build sentencepiece

[notice] A new release of pip is available: 24.2 -> 24.3.1 [notice] To update, run: pip install --upgrade pip ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (sentencepiece) (.venv) cadenmackenzie@Caden-Macbook-Pro-14 exo % pip install --upgrade pip Requirement already satisfied: pip in ./.venv/lib/python3.13/site-packages (24.2) Collecting pip Using cached pip-24.3.1-py3-none-any.whl.metadata (3.7 kB) Using cached pip-24.3.1-py3-none-any.whl (1.8 MB) Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 24.2 Uninstalling pip-24.2: Successfully uninstalled pip-24.2 Successfully installed pip-24.3.1 (.venv) cadenmackenzie@Caden-Macbook-Pro-14 exo % pip install -e . ... Installing build dependencies ... done Checking if build backend supports build_editable ... done Getting requirements to build editable ... done Preparing editable metadata (pyproject.toml) ... done Collecting tinygrad@ git+https://github.com/tinygrad/tinygrad.git@3b26e51fcebfc6576f4e0f99693e6f1406d61d79 (from exo==0.0.1) Using cached tinygrad-0.10.0-py3-none-any.whl Collecting aiohttp==3.10.11 (from exo==0.0.1) Using cached aiohttp-3.10.11-cp313-cp313-macosx_11_0_arm64.whl.metadata (7.7 kB) ... Using cached propcache-0.2.0-cp313-cp313-macosx_11_0_arm64.whl (44 kB) Building wheels for collected packages: exo, sentencepiece Building editable for exo (pyproject.toml) ... done Created wheel for exo: filename=exo-0.0.1-0.editable-py3-none-any.whl size=15497 sha256=69bcf46695741868f9e1ac6fdcaa59e44af745d3f0775620bf98f2f0da3c697d Stored in directory: /private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-ephem-wheel-cache-e9z4cjw8/wheels/2d/d5/ca/28701ccb455f52034a0510efc039d1f34787ce599fa8263435 Building wheel for sentencepiece (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for sentencepiece (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [109 lines of output] /private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite' warnings.warn(msg) running bdist_wheel running build running build_py creating build/lib.macosx-15.0-arm64-cpython-313/sentencepiece copying src/sentencepiece/init.py -> build/lib.macosx-15.0-arm64-cpython-313/sentencepiece copying src/sentencepiece/_version.py -> build/lib.macosx-15.0-arm64-cpython-313/sentencepiece copying src/sentencepiece/sentencepiece_model_pb2.py -> build/lib.macosx-15.0-arm64-cpython-313/sentencepiece copying src/sentencepiece/sentencepiece_pb2.py -> build/lib.macosx-15.0-arm64-cpython-313/sentencepiece running build_ext Package sentencepiece was not found in the pkg-config search path. Perhaps you should add the directory containing `sentencepiece.pc' to the PKG_CONFIG_PATH environment variable Package 'sentencepiece' not found ./build_bundled.sh: line 21: cmake: command not found ./build_bundled.sh: line 22: nproc: command not found ./build_bundled.sh: line 22: cmake: command not found Traceback (most recent call last): ... ^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 438, in build_wheel return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)]) File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 426, in _build return self._build_with_temp_dir( ~~~~~~~~~~~~~~~~~~~~~~~~~^ cmd, ^^^^ ...<3 lines>... self._arbitrary_args(config_settings), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir self.run_setup() ~~~~~~~~~~~~~~^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup super().run_setup(setup_script=setup_script) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup exec(code, locals()) ~~~~^^^^^^^^^^^^^^^^ File "", line 169, in File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/init.py", line 117, in setup return distutils.core.setup(**attrs) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 183, in setup return run_commands(dist) File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 199, in run_commands dist.run_commands() ~~~~~~~~~~~~~~~~~^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands self.run_command(cmd) ~~~~~~~~~~~~~~~~^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 995, in run_command super().run_command(command) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 973, in run_command cmd_obj.run() ~~~~~~~~~~~^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/command/bdist_wheel.py", line 381, in run self.run_command("build") ~~~~~~~~~~~~~~~~^^^^^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command self.distribution.run_command(command) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 995, in run_command super().run_command(command) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 973, in run_command cmd_obj.run() ~~~~~~~~~~~^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build.py", line 135, in run self.run_command(cmd_name) ~~~~~~~~~~~~~~~~^^^^^^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command self.distribution.run_command(command) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 995, in run_command super().run_command(command) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 973, in run_command cmd_obj.run() ~~~~~~~~~~~^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/command/build_ext.py", line 99, in run _build_ext.run(self) ~~~~~~~~~~~~~~^^^^^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run self.build_extensions() ~~~~~~~~~~~~~~~~~~~~~^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 476, in build_extensions self._build_extensions_serial() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/private/var/folders/zk/z31x678d3wnbf6tpgv_cw5940000gp/T/pip-build-env-56p25cw2/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 502, in _build_extensions_serial self.build_extension(ext) ~~~~~~~~~~~~~~~~~~~~^^^^^ File "", line 87, in build_extension File "/opt/homebrew/Cellar/[email protected]/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 419, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['./build_bundled.sh', '0.2.0']' returned non-zero exit status 127. [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for sentencepiece Successfully built exo Failed to build sentencepiece ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (sentencepiece) (.venv) cadenmackenzie@Caden-Macbook-Pro-14 exo %

cadenmackenzie avatar Nov 25 '24 18:11 cadenmackenzie

FWIW, I had to manually install python3.13 on Ubuntu 22,04, since it only supports up to python3.10. But it's fairly simple to get it to install:

  • Add the repo for python3.13 (python3.12 isn't really supported for 22.04 by this repo)
  • sudo add-apt-repository ppa:deadsnakes/ppa
    
  • Install required packages
  • sudo apt-get install python3.13  python3.13-dev python3.13-venv
    
  • Clone the repo and modify the "install.sh" script:
#!/usr/bin/env bash

if command -v python3.13 &>/dev/null; then
    echo "Python 3.13 is installed, proceeding with python3.13..."
    python3.13 -m venv .venv
else
    echo "The recommended version of Python to run exo with is Python 3.12, but $(python3 --version) is installed. Proceeding with $(python3 --version)"
    python3 -m venv .venv
fi
source .venv/bin/activate
pip install -e .

Then follow the rest of the install instructions.

No issues . . .

rabinnh avatar Feb 28 '25 15:02 rabinnh