Closed carolzbnbr closed 2 years ago
Hi @carolzbnbr and thanks for the detailed report!
I have the same system as yours but wasn't able to reproduce. I tried with a virtualenv (I am manually activating it here to avoid confusion but I usually have a project manger tool):
~ python -m venv ./myvenv
~ export PATH=$PWD/myvenv/bin:$PATH
~ which python
/Users/massi/myvenv/bin/python
~ pip install farm-haystack
...
~ pip show farm-haystack
Name: farm-haystack
Version: 1.8.0
~ python -c"from haystack.nodes import EmbeddingRetriever"
~
Can you try the above steps and let me know the output?
Hello @masci,
Thanks for helping me.
Here is the output I got by running python -c"from haystack.nodes import EmbeddingRetriever"
:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/carolinazambon/Projects/ArcTouch.AI.Search/src/python/myvenv/lib/python3.9/site-packages/haystack/nodes/__init__.py", line 1, in <module>
from haystack.utils.import_utils import safe_import
File "/Users/carolinazambon/Projects/ArcTouch.AI.Search/src/python/myvenv/lib/python3.9/site-packages/haystack/utils/__init__.py", line 2, in <module>
from haystack.utils.preprocessing import convert_files_to_docs, tika_convert_files_to_docs
File "/Users/carolinazambon/Projects/ArcTouch.AI.Search/src/python/myvenv/lib/python3.9/site-packages/haystack/utils/preprocessing.py", line 7, in <module>
from haystack.nodes.file_converter import BaseConverter, DocxToTextConverter, PDFToTextConverter, TextConverter
File "/Users/carolinazambon/Projects/ArcTouch.AI.Search/src/python/myvenv/lib/python3.9/site-packages/haystack/nodes/file_converter/__init__.py", line 1, in <module>
from haystack.nodes.file_converter.base import BaseConverter
File "/Users/carolinazambon/Projects/ArcTouch.AI.Search/src/python/myvenv/lib/python3.9/site-packages/haystack/nodes/file_converter/base.py", line 7, in <module>
from haystack.nodes.base import BaseComponent
File "/Users/carolinazambon/Projects/ArcTouch.AI.Search/src/python/myvenv/lib/python3.9/site-packages/haystack/nodes/base.py", line 11, in <module>
from haystack.errors import PipelineSchemaError
File "/Users/carolinazambon/Projects/ArcTouch.AI.Search/src/python/myvenv/lib/python3.9/site-packages/haystack/errors.py", line 5, in <module>
from haystack.telemetry import send_custom_event
File "/Users/carolinazambon/Projects/ArcTouch.AI.Search/src/python/myvenv/lib/python3.9/site-packages/haystack/telemetry.py", line 20, in <module>
from haystack.environment import HAYSTACK_EXECUTION_CONTEXT, get_or_create_env_meta_data
File "/Users/carolinazambon/Projects/ArcTouch.AI.Search/src/python/myvenv/lib/python3.9/site-packages/haystack/environment.py", line 8, in <module>
from haystack import __version__
ImportError: cannot import name '__version__' from 'haystack' (/Users/carolinazambon/Projects/ArcTouch.AI.Search/src/python/myvenv/lib/python3.9/site-packages/haystack/__init__.py)
I tried again, I don't know why, but everything seems fine now.
Thanks!
@carolzbnbr happy you solved the issue, let us know should you have more questions!
Run into the same error with conda but worked with venv
Describe the bug Getting error ModuleNotFoundError: No module named 'haystack.utils.import_utils'; 'haystack.utils' is not a package when importing EmbeddingRetriever
from haystack.nodes import EmbeddingRetriever
Error message ModuleNotFoundError: No module named 'haystack.utils.import_utils'; 'haystack.utils' is not a package
full error message/trace
Traceback (most recent call last): File "/Users/carolinazambon/Projects/ArcTouch.AI.Search/src/python/web/teste.py", line 1, in <module> from haystack.nodes import EmbeddingRetriever File "/Users/carolinazambon/Projects/ArcTouch.AI.Search/src/python/haystack/haystack/nodes/__init__.py", line 1, in <module> from haystack.utils.import_utils import safe_import ModuleNotFoundError: No module named 'haystack.utils.import_utils'; 'haystack.utils' is not a package
Expected behavior Run script without errors
Additional context I already attempted to execute basic installation, or full installation (using '.[all]' argument), the installation works like a charm, but when I run the script, I got the mentioned error.
To Reproduce 1 - Create a new .py file 2 - Add
from haystack.nodes import EmbeddingRetriever
4 - Save and runFAQ Check
System:
Side note: Attempted to execute on python 3.10 and 3.9