litellm - 💡(How to fix) Fix [Bug]: make test-unit fails with AttributeError: module 'responses' has no attribute 'activate' and ImportError: no pq wrapper available [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#23141Fetched 2026-04-08 00:38:27
View on GitHub
Comments
1
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×2closed ×1commented ×1cross-referenced ×1

Error Message

Error 2: psycopg fails to import due to missing libpq

ImportError: no pq wrapper available. Attempts made:

  • couldn't import psycopg 'c' implementation: No module named 'psycopg_c'
  • couldn't import psycopg 'binary' implementation: No module named 'psycopg_binary'
  • couldn't import psycopg 'python' implementation: libpq library not found

_______________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py _______________________________________________________________________________________ .venv/lib/python3.12/site-packages/_pytest/python.py:617: in _importtestmodule mod = import_path(self.path, mode=importmode, root=self.config.rootpath) .venv/lib/python3.12/site-packages/_pytest/pathlib.py:567: in import_path importlib.import_module(module_name) /usr/lib/python3.12/importlib/init.py:90: in import_module return _bootstrap._gcd_import(name[level:], package, level) <frozen importlib._bootstrap>:1387: in _gcd_import ??? <frozen importlib._bootstrap>:1360: in _find_and_load ??? <frozen importlib._bootstrap>:1331: in _find_and_load_unlocked ??? <frozen importlib._bootstrap>:935: in _load_unlocked ??? .venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:177: in exec_module source_stat, co = _rewrite_test(fn, self.config) .venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:359: in _rewrite_test tree = ast.parse(source, filename=strfn) /usr/lib/python3.12/ast.py:52: in parse return compile(source, filename, mode, flags, E File "/home/<username>/litellm-dev/tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py", line 481 E ), patch("litellm.proxy.proxy_server.prisma_client", mock_prisma): E ^ E SyntaxError: unmatched ')' ============================================================================================================================== warnings summary =============================================================================================================================== .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 /home/<username>/litellm-dev/.venv/lib/python3.12/site-packages/_pytest/config/init.py:1373: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope

self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================================================================================================================== short test summary info =========================================================================================================================== ERROR tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ======================================================================================================================== 5 warnings, 1 error in 15.90s ========================================================================================================================

================================================================================================================================== ERRORS ==================================================================================================================================== ________________________________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/client/test_chat.py ________________________________________________________________________________________________________ tests/test_litellm/proxy/client/test_chat.py:130: in <module> @responses.activate E AttributeError: module 'responses' has no attribute 'activate' ________________________________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/client/test_chat.py ________________________________________________________________________________________________________ tests/test_litellm/proxy/client/test_chat.py:130: in <module> @responses.activate E AttributeError: module 'responses' has no attribute 'activate' ________________________________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/client/test_chat.py ________________________________________________________________________________________________________ tests/test_litellm/proxy/client/test_chat.py:130: in <module> @responses.activate E AttributeError: module 'responses' has no attribute 'activate' ________________________________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/client/test_chat.py ________________________________________________________________________________________________________ tests/test_litellm/proxy/client/test_chat.py:130: in <module> @responses.activate E AttributeError: module 'responses' has no attribute 'activate' ============================================================================================================================== warnings summary =============================================================================================================================== .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 /home/<username>/litellm-dev/.venv/lib/python3.12/site-packages/_pytest/config/init.py:1373: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope

self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================================================================================================================== short test summary info =========================================================================================================================== ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate' ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate' ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate' ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 4 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ======================================================================================================================= 5 warnings, 4 errors in 12.36s ======================================================================================================================== make: *** [Makefile:142: test-unit] Error 2

Fix Action

Fix / Workaround

_______________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py _______________________________________________________________________________________ .venv/lib/python3.12/site-packages/_pytest/python.py:617: in _importtestmodule mod = import_path(self.path, mode=importmode, root=self.config.rootpath) .venv/lib/python3.12/site-packages/_pytest/pathlib.py:567: in import_path importlib.import_module(module_name) /usr/lib/python3.12/importlib/init.py:90: in import_module return _bootstrap._gcd_import(name[level:], package, level) <frozen importlib._bootstrap>:1387: in _gcd_import ??? <frozen importlib._bootstrap>:1360: in _find_and_load ??? <frozen importlib._bootstrap>:1331: in _find_and_load_unlocked ??? <frozen importlib._bootstrap>:935: in _load_unlocked ??? .venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:177: in exec_module source_stat, co = _rewrite_test(fn, self.config) .venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:359: in _rewrite_test tree = ast.parse(source, filename=strfn) /usr/lib/python3.12/ast.py:52: in parse return compile(source, filename, mode, flags, E File "/home/<username>/litellm-dev/tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py", line 481 E ), patch("litellm.proxy.proxy_server.prisma_client", mock_prisma): E ^ E SyntaxError: unmatched ')' ============================================================================================================================== warnings summary =============================================================================================================================== .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 .venv/lib/python3.12/site-packages/_pytest/config/init.py:1373 /home/<username>/litellm-dev/.venv/lib/python3.12/site-packages/_pytest/config/init.py:1373: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope

Code Example

**Error 2: `psycopg` fails to import due to missing `libpq`**

ImportError: no pq wrapper available.
Attempts made:
- couldn't import psycopg 'c' implementation: No module named 'psycopg_c'
- couldn't import psycopg 'binary' implementation: No module named 'psycopg_binary'
- couldn't import psycopg 'python' implementation: libpq library not found


_______________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py _______________________________________________________________________________________
.venv/lib/python3.12/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
.venv/lib/python3.12/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
.venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:177: in exec_module
    source_stat, co = _rewrite_test(fn, self.config)
.venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:359: in _rewrite_test
    tree = ast.parse(source, filename=strfn)
/usr/lib/python3.12/ast.py:52: in parse
    return compile(source, filename, mode, flags,
E     File "/home/<username>/litellm-dev/tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py", line 481
E       ), patch("litellm.proxy.proxy_server.prisma_client", mock_prisma):
E       ^
E   SyntaxError: unmatched ')'
============================================================================================================================== warnings summary ===============================================================================================================================
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
  /home/<username>/litellm-dev/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================================================================================================== short test summary info ===========================================================================================================================
ERROR tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================================================================== 5 warnings, 1 error in 15.90s ========================================================================================================================


================================================================================================================================== ERRORS ====================================================================================================================================
________________________________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/client/test_chat.py ________________________________________________________________________________________________________
tests/test_litellm/proxy/client/test_chat.py:130: in <module>
    @responses.activate
E   AttributeError: module 'responses' has no attribute 'activate'
________________________________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/client/test_chat.py ________________________________________________________________________________________________________
tests/test_litellm/proxy/client/test_chat.py:130: in <module>
    @responses.activate
E   AttributeError: module 'responses' has no attribute 'activate'
________________________________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/client/test_chat.py ________________________________________________________________________________________________________
tests/test_litellm/proxy/client/test_chat.py:130: in <module>
    @responses.activate
E   AttributeError: module 'responses' has no attribute 'activate'
________________________________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/client/test_chat.py ________________________________________________________________________________________________________
tests/test_litellm/proxy/client/test_chat.py:130: in <module>
    @responses.activate
E   AttributeError: module 'responses' has no attribute 'activate'
============================================================================================================================== warnings summary ===============================================================================================================================
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
  /home/<username>/litellm-dev/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================================================================================================== short test summary info ===========================================================================================================================
ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate'
ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate'
ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate'
ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 4 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================================================================= 5 warnings, 4 errors in 12.36s ========================================================================================================================
make: *** [Makefile:142: test-unit] Error 2
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

Running make test-unit on main fails for new contributors with two errors that make it impossible to run unit tests locally.

ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate'

Also when running "poetry install --with dev,proxy-dev --extras proxy" for the first time I got this error: `ImportError: no pq wrapper available. Attempts made:

  • couldn't import psycopg 'c' implementation: No module named 'psycopg_c'
  • couldn't import psycopg 'binary' implementation: No module named 'psycopg_binary'
  • couldn't import psycopg 'python' implementation: libpq library not found`

One last thing there is an error in the file ERROR tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py

Note: I'm a new contributor trying to set up the development environment to submit a PR. I spent significant time debugging these three issues, and I'm opening this issue so other contributors don't run into the same blockers.

Steps to Reproduce

  1. Clone the repo into WSL
  2. Run poetry install --with dev,proxy-dev --extras proxy
  3. Run make test-unit

Relevant log output

**Error 2: `psycopg` fails to import due to missing `libpq`**

ImportError: no pq wrapper available.
Attempts made:
- couldn't import psycopg 'c' implementation: No module named 'psycopg_c'
- couldn't import psycopg 'binary' implementation: No module named 'psycopg_binary'
- couldn't import psycopg 'python' implementation: libpq library not found


_______________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py _______________________________________________________________________________________
.venv/lib/python3.12/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
.venv/lib/python3.12/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
.venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:177: in exec_module
    source_stat, co = _rewrite_test(fn, self.config)
.venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:359: in _rewrite_test
    tree = ast.parse(source, filename=strfn)
/usr/lib/python3.12/ast.py:52: in parse
    return compile(source, filename, mode, flags,
E     File "/home/<username>/litellm-dev/tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py", line 481
E       ), patch("litellm.proxy.proxy_server.prisma_client", mock_prisma):
E       ^
E   SyntaxError: unmatched ')'
============================================================================================================================== warnings summary ===============================================================================================================================
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
  /home/<username>/litellm-dev/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================================================================================================== short test summary info ===========================================================================================================================
ERROR tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================================================================== 5 warnings, 1 error in 15.90s ========================================================================================================================


================================================================================================================================== ERRORS ====================================================================================================================================
________________________________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/client/test_chat.py ________________________________________________________________________________________________________
tests/test_litellm/proxy/client/test_chat.py:130: in <module>
    @responses.activate
E   AttributeError: module 'responses' has no attribute 'activate'
________________________________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/client/test_chat.py ________________________________________________________________________________________________________
tests/test_litellm/proxy/client/test_chat.py:130: in <module>
    @responses.activate
E   AttributeError: module 'responses' has no attribute 'activate'
________________________________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/client/test_chat.py ________________________________________________________________________________________________________
tests/test_litellm/proxy/client/test_chat.py:130: in <module>
    @responses.activate
E   AttributeError: module 'responses' has no attribute 'activate'
________________________________________________________________________________________________________ ERROR collecting tests/test_litellm/proxy/client/test_chat.py ________________________________________________________________________________________________________
tests/test_litellm/proxy/client/test_chat.py:130: in <module>
    @responses.activate
E   AttributeError: module 'responses' has no attribute 'activate'
============================================================================================================================== warnings summary ===============================================================================================================================
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373
  /home/<username>/litellm-dev/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1373: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================================================================================================== short test summary info ===========================================================================================================================
ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate'
ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate'
ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate'
ERROR tests/test_litellm/proxy/client/test_chat.py - AttributeError: module 'responses' has no attribute 'activate'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 4 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================================================================= 5 warnings, 4 errors in 12.36s ========================================================================================================================
make: *** [Makefile:142: test-unit] Error 2

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.82.1

Twitter / LinkedIn details

No response

extent analysis

Fix Plan

To resolve the issues, follow these steps:

  • Install the libpq library:
    • On Ubuntu/Debian: sudo apt-get install libpq-dev
    • On Red Hat/Fedora: sudo dnf install postgresql-devel
  • Upgrade the responses library:
    • Run poetry update responses to ensure you have the latest version
  • Fix the syntax error in test_byok_oauth_endpoints.py:
    • Locate the line with the syntax error (line 481) and fix the unmatched parenthesis

Example code to verify the responses library version:

import responses

print(responses.__version__)

If the version is outdated, update it using poetry update responses.

Verification

After applying the fixes, re-run the following commands to verify that the issues are resolved:

poetry install --with dev,proxy-dev --extras proxy
make test-unit

If the tests pass without errors, the fixes were successful.

Extra Tips

  • Ensure that your development environment is up-to-date and consistent with the project's requirements.
  • If you encounter further issues, check the project's documentation and issue tracker for known problems and solutions.
  • Consider adding a check for the libpq library and the responses library version in your project's setup script to prevent similar issues in the future.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING