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

Python 3.12 support #300

Closed
kwikiel opened this issue Oct 31, 2023 · 10 comments · Fixed by #431
Closed

Python 3.12 support #300

kwikiel opened this issue Oct 31, 2023 · 10 comments · Fixed by #431
Labels
enhancement New feature or request

Comments

@kwikiel
Copy link

kwikiel commented Oct 31, 2023

Seems like it's failing on pip install in 3.12

     register_finder(pkgutil.ImpImporter, find_on_path)
                          ^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

"Due to removal of long deprecated pkgutil.ImpImporter class, pip command may not work for Python 3.12"

it seems like it could work fine in 3.11 but I will investigate ways to run it on 3.12 and contribute PR or workarounds when I will find a way to install it.

@kwikiel
Copy link
Author

kwikiel commented Oct 31, 2023

Fixed numpy and scipy by simply updating the versions but there are missing wheels for tree sitter:

tree-sitter/py-tree-sitter#161

Once the above pull request is merged, the 3.12 would be hopefully possible.

@paul-gauthier paul-gauthier added the enhancement New feature or request label Oct 31, 2023
@paul-gauthier
Copy link
Collaborator

This is great, thanks for doing the investigation to see what was blocking 3.12. I've been meaning to dig in here, but haven't had a chance yet.

@paul-gauthier
Copy link
Collaborator

I've updated numpy and scipy.

This ticket is tracking the blocker in py-tree-sitter-languages:

grantjenks/py-tree-sitter-languages#30

@paul-gauthier
Copy link
Collaborator

A new version of py-tree-sitter-languages was just released that unblocked aider support for python 3.12. I've bumped all the versions and all tests pass on 3.12.

The change is available in the main branch. You can get it by installing the latest version from github:

python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git

If you have a chance to try it, let me know if it works for you.

@Hexodus
Copy link

Hexodus commented Jan 5, 2024

Well I thought that it'll work with the minor version higher but it doesn't.
image

@paul-gauthier
Copy link
Collaborator

@Hexodus the version that supports 3.12 has not been released to pypi yet. It's only available if you install the main branch from GitHub per the instructions in my previous message.

@paul-gauthier
Copy link
Collaborator

Sorry, my mistake! I just pushed a fix to tell pip that it's allowed to install with python 3.12.

@Hexodus
Copy link

Hexodus commented Jan 5, 2024

@paul-gauthier Wow, you're fast! But in the meantime I installed python 3.11.7 😄
Anyways it's good to see that you care so much and good for the next folks to be able to install with python 3.12 now ;-)

@Huge
Copy link

Huge commented Jun 21, 2024

Hmm, it seems broken to me but possibly I'm missing something obvious...
docker run -it python:3.13.0b2-alpine3.20 sh

cb23f344946d:/aider# python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git
Collecting git+https://github.com/paul-gauthier/aider.git
  Cloning https://github.com/paul-gauthier/aider.git to /tmp/pip-req-build-e3im3rt4
  Running command git clone --filter=blob:none --quiet https://github.com/paul-gauthier/aider.git /tmp/pip-req-build-e3im3rt4
  Resolved https://github.com/paul-gauthier/aider.git to commit 5f0f9daa3a15789b809ea6f1130d55e0ad798d3e
  Preparing metadata (setup.py) ... done
Collecting aiohttp==3.9.5 (from aider-chat==0.39.1.dev0)
  Downloading aiohttp-3.9.5.tar.gz (7.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.5/7.5 MB 1.7 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting aiosignal==1.3.1 (from aider-chat==0.39.1.dev0)
  Using cached aiosignal-1.3.1-py3-none-any.whl.metadata (4.0 kB)
Collecting altair==5.3.0 (from aider-chat==0.39.1.dev0)
  Downloading altair-5.3.0-py3-none-any.whl.metadata (9.2 kB)
Collecting annotated-types==0.7.0 (from aider-chat==0.39.1.dev0)
  Downloading annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB)
Collecting anyio==4.4.0 (from aider-chat==0.39.1.dev0)
  Downloading anyio-4.4.0-py3-none-any.whl.metadata (4.6 kB)
Collecting attrs==23.2.0 (from aider-chat==0.39.1.dev0)
  Downloading attrs-23.2.0-py3-none-any.whl.metadata (9.5 kB)
Collecting backoff==2.2.1 (from aider-chat==0.39.1.dev0)
  Using cached backoff-2.2.1-py3-none-any.whl.metadata (14 kB)
Collecting beautifulsoup4==4.12.3 (from aider-chat==0.39.1.dev0)
  Downloading beautifulsoup4-4.12.3-py3-none-any.whl.metadata (3.8 kB)
Collecting blinker==1.8.2 (from aider-chat==0.39.1.dev0)
  Downloading blinker-1.8.2-py3-none-any.whl.metadata (1.6 kB)
Collecting cachetools==5.3.3 (from aider-chat==0.39.1.dev0)
  Downloading cachetools-5.3.3-py3-none-any.whl.metadata (5.3 kB)
Collecting certifi==2024.6.2 (from aider-chat==0.39.1.dev0)
  Downloading certifi-2024.6.2-py3-none-any.whl.metadata (2.2 kB)
Collecting cffi==1.16.0 (from aider-chat==0.39.1.dev0)
  Downloading cffi-1.16.0.tar.gz (512 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 512.9/512.9 kB 1.3 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting charset-normalizer==3.3.2 (from aider-chat==0.39.1.dev0)
  Downloading charset_normalizer-3.3.2-py3-none-any.whl.metadata (33 kB)
Collecting click==8.1.7 (from aider-chat==0.39.1.dev0)
  Downloading click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting configargparse==1.7 (from aider-chat==0.39.1.dev0)
  Using cached ConfigArgParse-1.7-py3-none-any.whl.metadata (23 kB)
Collecting diff-match-patch==20230430 (from aider-chat==0.39.1.dev0)
  Downloading diff_match_patch-20230430-py3-none-any.whl.metadata (5.2 kB)
Collecting diskcache==5.6.3 (from aider-chat==0.39.1.dev0)
  Downloading diskcache-5.6.3-py3-none-any.whl.metadata (20 kB)
Collecting distro==1.9.0 (from aider-chat==0.39.1.dev0)
  Downloading distro-1.9.0-py3-none-any.whl.metadata (6.8 kB)
Collecting filelock==3.15.1 (from aider-chat==0.39.1.dev0)
  Downloading filelock-3.15.1-py3-none-any.whl.metadata (2.8 kB)
Collecting flake8==7.1.0 (from aider-chat==0.39.1.dev0)
  Downloading flake8-7.1.0-py2.py3-none-any.whl.metadata (3.8 kB)
Collecting frozenlist==1.4.1 (from aider-chat==0.39.1.dev0)
  Downloading frozenlist-1.4.1-py3-none-any.whl.metadata (12 kB)
Collecting fsspec==2024.6.0 (from aider-chat==0.39.1.dev0)
  Downloading fsspec-2024.6.0-py3-none-any.whl.metadata (11 kB)
Collecting gitdb==4.0.11 (from aider-chat==0.39.1.dev0)
  Downloading gitdb-4.0.11-py3-none-any.whl.metadata (1.2 kB)
Collecting gitpython==3.1.43 (from aider-chat==0.39.1.dev0)
  Downloading GitPython-3.1.43-py3-none-any.whl.metadata (13 kB)
Collecting google-ai-generativelanguage==0.6.4 (from aider-chat==0.39.1.dev0)
  Downloading google_ai_generativelanguage-0.6.4-py3-none-any.whl.metadata (5.6 kB)
Collecting google-api-core==2.19.0 (from google-api-core[grpc]==2.19.0->aider-chat==0.39.1.dev0)
  Downloading google_api_core-2.19.0-py3-none-any.whl.metadata (2.7 kB)
Collecting google-api-python-client==2.133.0 (from aider-chat==0.39.1.dev0)
  Downloading google_api_python_client-2.133.0-py2.py3-none-any.whl.metadata (6.7 kB)
Collecting google-auth==2.30.0 (from aider-chat==0.39.1.dev0)
  Downloading google_auth-2.30.0-py2.py3-none-any.whl.metadata (4.7 kB)
Collecting google-auth-httplib2==0.2.0 (from aider-chat==0.39.1.dev0)
  Downloading google_auth_httplib2-0.2.0-py2.py3-none-any.whl.metadata (2.2 kB)
Collecting google-generativeai==0.6.0 (from aider-chat==0.39.1.dev0)
  Downloading google_generativeai-0.6.0-py3-none-any.whl.metadata (3.9 kB)
Collecting googleapis-common-protos==1.63.1 (from aider-chat==0.39.1.dev0)
  Downloading googleapis_common_protos-1.63.1-py2.py3-none-any.whl.metadata (1.5 kB)
Collecting greenlet==3.0.3 (from aider-chat==0.39.1.dev0)
  Downloading greenlet-3.0.3.tar.gz (182 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 182.0/182.0 kB 1.2 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting grep-ast==0.3.2 (from aider-chat==0.39.1.dev0)
  Downloading grep_ast-0.3.2-py3-none-any.whl.metadata (2.6 kB)
Collecting grpcio==1.64.1 (from aider-chat==0.39.1.dev0)
  Downloading grpcio-1.64.1.tar.gz (12.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.2/12.2 MB 1.5 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
          exec(compile('''
          ~~~~^^^^^^^^^^^^
          # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          ...<31 lines>...
          exec(compile(setup_py_code, filename, "exec"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          ''' % ('/tmp/pip-install-uakx_pu4/grpcio_c2f26ef838844cfc80ca62cc9235840b/setup.py',), "<pip-setuptools-caller>", "exec"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-uakx_pu4/grpcio_c2f26ef838844cfc80ca62cc9235840b/setup.py", line 271, in <module>
          if check_linker_need_libatomic():
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
        File "/tmp/pip-install-uakx_pu4/grpcio_c2f26ef838844cfc80ca62cc9235840b/setup.py", line 215, in check_linker_need_libatomic
          cpp_test = subprocess.Popen(
              cxx + ["-x", "c++", "-std=c++14", "-"],
          ...<2 lines>...
              stderr=PIPE,
          )
        File "/usr/local/lib/python3.13/subprocess.py", line 1036, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                              pass_fds, cwd, env,
                              ^^^^^^^^^^^^^^^^^^^
          ...<5 lines>...
                              gid, gids, uid, umask,
                              ^^^^^^^^^^^^^^^^^^^^^^
                              start_new_session, process_group)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/lib/python3.13/subprocess.py", line 1966, in _execute_child
          raise child_exception_type(errno_num, err_msg, err_filename)
      FileNotFoundError: [Errno 2] No such file or directory: 'c++'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[notice] A new release of pip is available: 24.0 -> 24.1

@pchaganti
Copy link

image

Tried installing from git using

python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git
Collecting tokenizers==0.19.1 (from aider-chat==0.59.2.dev45+ge76704e2)
  Downloading tokenizers-0.19.1.tar.gz (321 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting tqdm==4.66.5 (from aider-chat==0.59.2.dev45+ge76704e2)
  Downloading tqdm-4.66.5-py3-none-any.whl.metadata (57 kB)
Collecting tree-sitter==0.21.3 (from aider-chat==0.59.2.dev45+ge76704e2)
  Downloading tree-sitter-0.21.3.tar.gz (155 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
INFO: pip is looking at multiple versions of aider-chat to determine which version is compatible with other requirements. This could take a while.
ERROR: Ignored the following versions that require a different python version: 0.21.0 Requires-Python <3.12,>=3.8; 1.10.0 Requires-Python <3.12,>=3.8; 1.10.0rc1 Requires-Python <3.12,>=3.8; 1.10.0rc2 Requires-Python <3.12,>=3.8; 1.10.1 Requires-Python <3.12,>=3.8; 1.11.0 Requires-Python <3.13,>=3.9; 1.11.0rc1 Requires-Python <3.13,>=3.9; 1.11.0rc2 Requires-Python <3.13,>=3.9; 1.11.1 Requires-Python <3.13,>=3.9; 1.11.2 Requires-Python <3.13,>=3.9; 1.11.3 Requires-Python <3.13,>=3.9; 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11; 1.26.0 Requires-Python <3.13,>=3.9; 1.26.1 Requires-Python <3.13,>=3.9; 1.6.2 Requires-Python >=3.7,<3.10; 1.6.3 Requires-Python >=3.7,<3.10; 1.7.0 Requires-Python >=3.7,<3.10; 1.7.1 Requires-Python >=3.7,<3.10; 1.7.2 Requires-Python >=3.7,<3.11; 1.7.3 Requires-Python >=3.7,<3.11; 1.8.0 Requires-Python >=3.8,<3.11; 1.8.0rc1 Requires-Python >=3.8,<3.11; 1.8.0rc2 Requires-Python >=3.8,<3.11; 1.8.0rc3 Requires-Python >=3.8,<3.11; 1.8.0rc4 Requires-Python >=3.8,<3.11; 1.8.1 Requires-Python >=3.8,<3.11; 1.9.0 Requires-Python >=3.8,<3.12; 1.9.0rc1 Requires-Python >=3.8,<3.12; 1.9.0rc2 Requires-Python >=3.8,<3.12; 1.9.0rc3 Requires-Python >=3.8,<3.12; 1.9.1 Requires-Python >=3.8,<3.12
ERROR: Could not find a version that satisfies the requirement tree-sitter-languages==1.10.2 (from aider-chat) (from versions: none)
ERROR: No matching distribution found for tree-sitter-languages==1.10.2

This was referenced Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants