Open jakejellinek opened 1 year ago
Let me take a look
I'm on macOS Monterey Version 12.5.1 Python 3.11.1 Using Bash
I get this error when I run 'aicommit'
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/bin/aicommit", line 5, in
I scanned through the article @jakejellinek shared. Does reverting back to Python 3.9 solve anything?
I'm on Python 3.9.13 locally btw. And that's what I tested against. I can try it tomorrow with 3.10 and 3.11
Also, looks like an issue with PyInquirer. I wonder if they have any solutions that I can upgrade the dependency to.
I'm having a hard time reproducing this locally with pyenv.
Some potential solutions:
Would love some help to actually fix this issue in this package.
@abi I'm on 3.9.13 locally, and I'm getting this error:
Traceback (most recent call last):
File "/Users/ryanefendy/.pyenv/versions/3.9.13/bin/aicommit", line 5, in <module>
from autocommit.commit import main
File "/Users/ryanefendy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/autocommit/commit.py", line 29, in <module>
prompt = CustomPromptTemplate(
TypeError: Can't instantiate abstract class CustomPromptTemplate with abstract method _prompt_type
@abi I'm on 3.9.13 locally, and I'm getting this error:
Traceback (most recent call last): File "/Users/ryanefendy/.pyenv/versions/3.9.13/bin/aicommit", line 5, in <module> from autocommit.commit import main File "/Users/ryanefendy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/autocommit/commit.py", line 29, in <module> prompt = CustomPromptTemplate( TypeError: Can't instantiate abstract class CustomPromptTemplate with abstract method _prompt_type
Can confirm I saw this as well after correcting the from collections.abc import Mapping
import statement
I managed to fix it by commenting out the abstract method decorators - after that everything worked as expected!
awesome @JWBWork
@abi I'm on 3.9.13 locally, and I'm getting this error:
Traceback (most recent call last): File "/Users/ryanefendy/.pyenv/versions/3.9.13/bin/aicommit", line 5, in <module> from autocommit.commit import main File "/Users/ryanefendy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/autocommit/commit.py", line 29, in <module> prompt = CustomPromptTemplate( TypeError: Can't instantiate abstract class CustomPromptTemplate with abstract method _prompt_type
Can confirm I saw this as well after correcting the
from collections.abc import Mapping
import statementI managed to fix it by commenting out the abstract method decorators - after that everything worked as expected!
The same happens with 3.8
Python 3.10.2:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/bin/aicommit", line 5, in <module>
from autocommit.commit import main
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autocommit/commit.py", line 2, in <module>
from PyInquirer import prompt as py_inquirer_prompt, style_from_dict, Token
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PyInquirer/__init__.py", line 6, in <module>
from prompt_toolkit.token import Token
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
from .interface import CommandLineInterface
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/interface.py", line 19, in <module>
from .application import Application, AbortAction
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/application.py", line 8, in <module>
from .key_binding.bindings.basic import load_basic_bindings
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/key_binding/bindings/basic.py", line 9, in <module>
from prompt_toolkit.renderer import HeightIsUnknownError
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/renderer.py", line 11, in <module>
from prompt_toolkit.styles import Style
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/styles/__init__.py", line 8, in <module>
from .from_dict import *
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prompt_toolkit/styles/from_dict.py", line 9, in <module>
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
@abi I'm on 3.9.13 locally, and I'm getting this error:
Traceback (most recent call last): File "/Users/ryanefendy/.pyenv/versions/3.9.13/bin/aicommit", line 5, in <module> from autocommit.commit import main File "/Users/ryanefendy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/autocommit/commit.py", line 29, in <module> prompt = CustomPromptTemplate( TypeError: Can't instantiate abstract class CustomPromptTemplate with abstract method _prompt_type
Can confirm I saw this as well after correcting the
from collections.abc import Mapping
import statementI managed to fix it by commenting out the abstract method decorators - after that everything worked as expected!
Sorry, what exactly you commented?
I have changed
class CustomPromptTemplate(BasePromptTemplate, BaseModel):
template: str
def format(self, **kwargs) -> str:
c_kwargs = {k: v for k, v in kwargs.items()}
return self.template.format(**c_kwargs)
to
class CustomPromptTemplate(BasePromptTemplate, BaseModel):
template: str
def format_prompt(self, **kwargs) -> str:
c_kwargs = {k: v for k, v in kwargs.items()}
return self.template.format(**c_kwargs)
def format(self, **kwargs) -> str:
return self.format_prompt(**kwargs)
now it looks like it's works,
Other issue from OpenAI API:
Retrying langchain.llms.openai.completion_with_retry.
._completion_with_retry in 4.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan
I did a pip install, using python 3.10.6 and I get this error:-
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/init.py)
A google search led me to this page which may explain the issue:-
https://bobbyhadz.com/blog/python-importerror-cannot-import-name-mapping-from-collections