snowby666 / poe-api-wrapper

👾 A Python API wrapper for Poe.com. With this, you will have free access to GPT-4, Claude, Llama, Gemini, Mistral and more! 🚀
https://pypi.org/project/poe-api-wrapper/
GNU General Public License v3.0
677 stars 81 forks source link

Release 1.4.1, using Python 3.12.3 on MacOS, doesn't work #145

Closed carmelolg closed 2 months ago

carmelolg commented 2 months ago

Using the version 1.4.1 I retrieve the following error:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/bin/poe", line 5, in <module>
    from poe_api_wrapper.cli import main
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/poe_api_wrapper/__init__.py", line 2, in <module>
    from .async_api import AsyncPoeApi
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/poe_api_wrapper/async_api.py", line 13, in <module>
    import nest_asyncio
ModuleNotFoundError: No module named 'nest_asyncio'

The behavior is the same both in the terminal and through Python scripts.

Here the script used:

# Using poe.com tokens
tokens = {
    'b': 'my token b',
    'lat': 'my token lat'
}

from poe_api_wrapper import PoeApi
client = PoeApi(cookie=tokens, auto_proxy=True)

My workaround

I downgraded the release version to the 1.4.0 and I changed the script with the following text

# Using poe.com tokens
tokens = {
    'b': 'my token b',
    'lat': 'my token lat'
}

from poe_api_wrapper import PoeApi
client = PoeApi(cookie=tokens, auto_proxy=False) # You can omit the auto_proxy
snowby666 commented 2 months ago

You are missing the nest_asyncio library. Installing it with pip will fix the error

carmelolg commented 2 months ago

My personal opinion: add this step to the docs. There isn't a referral about this lib in the docs (or I miss it?)

C.