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

Can't run tests using Pytest #209

Closed
Tylersuard opened this issue May 3, 2024 · 3 comments
Closed

Can't run tests using Pytest #209

Tylersuard opened this issue May 3, 2024 · 3 comments
Labels
Bug Something isn't working

Comments

@Tylersuard
Copy link

ImportError while loading conftest 'C:\Users\tyler\OneDrive\Desktop\App Ideas and Work\mirascope\mirascope\tests\conftest.py'.
tests\conftest.py:6: in
from anthropic.types import (
E ModuleNotFoundError: No module named 'anthropic'

@Tylersuard Tylersuard added the Bug Something isn't working label May 3, 2024
@Tylersuard
Copy link
Author

Ok I think I solved that issue, now I am getting a different issue: Fatal Python error: init_import_site: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "C:\Python310\lib\site.py", line 186, in addpackage
exec(line)
File "", line 1, in
File "C:\Users\tyler\OneDrive\Desktop\App Ideas and Work\mirascope\mirascope\mirascope\types.py", line 1, in
from typing import TypeVar
File "C:\Python310\lib\typing.py", line 25, in
import contextlib
File "C:\Python310\lib\contextlib.py", line 6, in
from functools import wraps
File "C:\Python310\lib\functools.py", line 22, in
from types import GenericAlias
ImportError: cannot import name 'GenericAlias' from partially initialized module 'types' (most likely due to a circular import) (C:\Users\tyler\OneDrive\Desktop\App Ideas and Work\mirascope\mirascope\mirascope\types.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Python310\lib\site.py", line 617, in
main()
File "C:\Python310\lib\site.py", line 603, in main
known_paths = addusersitepackages(known_paths)
File "C:\Python310\lib\site.py", line 343, in addusersitepackages
addsitedir(user_site, known_paths)
File "C:\Python310\lib\site.py", line 226, in addsitedir
addpackage(sitedir, name, known_paths)
File "C:\Python310\lib\site.py", line 196, in addpackage
import traceback
File "C:\Python310\lib\traceback.py", line 5, in
import linecache
File "C:\Python310\lib\linecache.py", line 8, in
import functools
File "C:\Python310\lib\functools.py", line 22, in
from types import GenericAlias
File "C:\Users\tyler\OneDrive\Desktop\App Ideas and Work\mirascope\mirascope\mirascope\types.py", line 1, in
from typing import TypeVar
File "C:\Python310\lib\typing.py", line 25, in
import contextlib
File "C:\Python310\lib\contextlib.py", line 6, in
from functools import wraps
ImportError: cannot import name 'wraps' from partially initialized module 'functools' (most likely due to a circular import) (C:\Python310\lib\functools.py)

@willbakst
Copy link
Contributor

I just pulled from dev and ran poetry run pytest tests with no issue.

Are you running this from current dev or from a different fork/branch?

@willbakst
Copy link
Contributor

I am going to close this issue as I haven't been able to reproduce locally. If this problem still persists, please reopen this issue with additional details for how to reproduce.

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