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

AIOHTTP Error #781

Open
VSandwar74 opened this issue Dec 31, 2024 · 3 comments
Open

AIOHTTP Error #781

VSandwar74 opened this issue Dec 31, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@VSandwar74
Copy link

$pqa --llm groq/llama3-8b-8192 --summary_llm groq/llama3-8b-8192 ask "what is ARCH"                                            
  + Exception Group Traceback (most recent call last):
  |   File "/Library/Frameworks/Python.framework/Versions/3.11/bin/pqa", line 8, in <module>
  |     sys.exit(main())
  |              ^^^^^^
...
    |   File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/__init__.py", line 254, in __getattr__
    |     raise AttributeError(f"module {__name__} has no attribute {name}")
    | AttributeError: module aiohttp has no attribute ClientConnectionResetError. Did you mean: 'ClientConnectionError'?
    +------------------------------------
sys:1: RuntimeWarning: coroutine 'MetadataPostProcessor.process' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x12a121c50>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x12ca95e80>, 25720.358243708)]']
connector: <aiohttp.connector.TCPConnector object at 0x1296000d0>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x12cad2850>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x12ca96190>, 25719.605680375)]']
connector: <aiohttp.connector.TCPConnector object at 0x12cd0e8d0>

I've tried solving this error for so long, I've previously had some issues with SSL certificates, but those should be resolved by now. Issue at #759, should solve the problem but I've used both aiohttp==3.10.6
and aiohttp==3.11.11, both to same problem. Running this on a .venv/bin/python, 3.11, macOS, certifi==2024.12.14, paper-qa==5.8.0. I've exported my GROQ api-key. I've also ran this on a main.py, to no avail.

from paperqa import Settings, ask, Docs
from dotenv import load_dotenv
load_dotenv()

answer = ask(
    "What manufacturing challenges are unique to bispecific antibodies?",
    settings=Settings(
        llm="groq/llama3-8b-8192", 
        summary_llm="groq/llama3-8b-8192",
        paper_directory="docs",
    ),
)
Copy link

dosubot bot commented Dec 31, 2024

Hey there, @VSandwar74! I'm here to help you with any bugs, questions, or contributions you might have for the paper-qa project. Let's tackle this aiohttp error together!

To resolve the AttributeError related to aiohttp not having the attribute ClientConnectionResetError, ensure that you are using aiohttp version 3.10.6 or higher. However, since you've already tried both aiohttp==3.10.6 and aiohttp==3.11.11 without success, it might be worth checking if there are any remnants of older versions or conflicting installations in your environment.

Here are a few steps you can take to troubleshoot and potentially resolve the issue:

  1. Verify Environment: Ensure that your virtual environment is activated and that there are no conflicting installations. You can list installed packages with:

    pip list
  2. Reinstall aiohttp: Try uninstalling and reinstalling aiohttp to ensure a clean installation:

    pip uninstall aiohttp
    pip install aiohttp==3.11.11
  3. Check for Conflicts: Ensure there are no other packages that might be causing conflicts with aiohttp. You can use tools like pipdeptree to inspect dependencies:

    pip install pipdeptree
    pipdeptree
  4. Update Dependencies: Make sure all other dependencies are up to date and compatible with Python 3.11. You can update them using:

    pip install --upgrade -r requirements.txt
  5. Debugging: If the problem persists, consider running your script with increased verbosity or debugging options to gather more information about the error.

If these steps do not resolve the issue, it might be helpful to look into the specific usage of aiohttp within the paperqa library to ensure there are no internal issues or misconfigurations. Additionally, the unclosed client sessions and connectors warning suggests that there might be an issue with how sessions are being managed in your code. Ensure that all aiohttp sessions are properly closed after use.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added the bug Something isn't working label Dec 31, 2024
@VSandwar74
Copy link
Author

├── litellm [required: >=1.44, installed: 1.56.4]
│ ├── aiohttp [required: Any, installed: 3.10.6]
│ │ ├── aiohappyeyeballs [required: >=2.3.0, installed: 2.4.4]
│ │ ├── aiosignal [required: >=1.1.2, installed: 1.3.2]
│ │ │ └── frozenlist [required: >=1.1.0, installed: 1.5.0]
│ │ ├── attrs [required: >=17.3.0, installed: 24.3.0]
│ │ ├── frozenlist [required: >=1.1.1, installed: 1.5.0]
│ │ ├── multidict [required: >=4.5,<7.0, installed: 6.1.0]
│ │ └── yarl [required: >=1.12.0,<2.0, installed: 1.18.3]
│ │ ├── idna [required: >=2.0, installed: 3.10]
│ │ ├── multidict [required: >=4.0, installed: 6.1.0]
│ │ └── propcache [required: >=0.2.0, installed: 0.2.1]

@jamesbraza
Copy link
Collaborator

Hi @VSandwar74 looks like you are hitting: AttributeError: module aiohttp has no attribute ClientConnectionResetError. Did you mean: 'ClientConnectionError'?

To share, we use aiohttp==3.11.10 in our local dev right now:

paper-qa/uv.lock

Lines 31 to 32 in 525bb32

name = "aiohttp"
version = "3.11.10"

I am thinking you might have a different aiohttp version in your actual env than what is printed by pip list.

When you run your Python module, can you print the aiohttp.__version__ to confirm what version you have?

import aiohttp
from paperqa import Settings, ask, Docs
from dotenv import load_dotenv

print(aiohttp.__version__)

load_dotenv()

answer = ask(
    ...
)

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

2 participants