Scrapegraph-ai
Scrapegraph-ai copied to clipboard
ModuleNotFoundError: No module named 'scrapegraphai.graphs'; 'scrapegraphai' is not a package
I have pip installed with no error reported. in both virtual and source environments.
When I try to run if fails...
Exception has occurred: ModuleNotFoundError
No module named 'scrapegraphai.graphs'; 'scrapegraphai' is not a package
AttributeError: partially initialized module 'scrapegraphai' has no attribute '__path__' (most likely due to a circular import)
During handling of the above exception, another exception occurred:
File "D:\_SimpleMovie\scrapegraphai.py", line 2, in <module>
from scrapegraphai.graphs import SmartScraperGraph
File "D:\_SimpleMovie\scrapegraphai.py", line 2, in <module>
from scrapegraphai.graphs import SmartScraperGraph
ModuleNotFoundError: No module named 'scrapegraphai.graphs'; 'scrapegraphai' is not a package
Desktop (please complete the following information):
- OS: Win 11
- python 3.11.4
Hey @Bandit253 can you try re-installing it now in a new virtual environment?
We made an update
Sorry, no luck :(
First I tried Upgrade, same then I tried uninstall, and re-install, result consistent... below
Successfully installed scrapegraphai-0.10.1
D:\_SimpleMovie>.env311\Scripts\python.exe
Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from scrapegraphai.graphs import SmartScraperGraph
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\scrapegraphai.py", line 2, in <module>
from scrapegraphai.graphs import SmartScraperGraph
ModuleNotFoundError: No module named 'scrapegraphai.graphs'; 'scrapegraphai' is not a package
Why does it list a script name when I just used command prompt? with no reference to that file?
@Bandit253 if you have environment activated could you try after just using python
command to start the interpreter. Invoking the python.exe like above may cause issue such as above.
@Bandit253 if you have environment activated could you try after just using
python
command to start the interpreter. Invoking the python.exe like above may cause issue such as above.
Yes, that appears to work, well at least no error on import. So:
- fresh environment
- Activated
- Python.exe
- Import works BUT;
- not Activated it doesn't work,
- just using new env python.exe doesn't
How can this be? Before I forget, thanks for the help!
Update on last.
"... at least no error on import." was completely correct when I tried to run the script, in activated env, same import error :(
(.SCRAPE) D:\>python _SimpleMovie\scrapegraphai.py
Traceback (most recent call last):
File "D:\_SimpleMovie\scrapegraphai.py", line 2, in <module>
from scrapegraphai.graphs import SmartScraperGraph
File "D:\_SimpleMovie\scrapegraphai.py", line 2, in <module>
from scrapegraphai.graphs import SmartScraperGraph
ModuleNotFoundError: No module named 'scrapegraphai.graphs'; 'scrapegraphai' is not a package
scrapegraphai.py
the issue is how Module Import works in Python:)
Please try changing the name of your file scrapegraphai.py
, since third-party module name is same.
Lol
scrapegraphai.py
the issue is how Module Import works in Python:) Please try changing the name of your file
scrapegraphai.py
, since third-party module name is same.
Yeah that makes sense, NOW, well spotted!! Thank you all