Issue
I was working on scrapy and received project (let's name it "alien_project") from other developer, after launching it I've faced scrapy problems. My old projects works and completes but when I try to create new projects error appears, seems like it tries to start from that "alien_project". Here's error I get in terminal:
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\Scripts\scrapy.exe\__main__.py", line 7, in <module>
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\scrapy\cmdline.py", line 125, in execute
settings = get_project_settings()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\scrapy\utils\project.py", line 71, in get_project_settings
settings.setmodule(settings_module_path, priority="project")
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\scrapy\settings\__init__.py", line 323, in setmodule
module = import_module(module)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'alien_project'
I already tried to reinstall Python. I also get this error working in virtual environmet. Didn't find somethins suspicious in that project, maybe it's just an coincedence, but Scrapy always refers to that "alien_project" project.
I'm using: Windows 11 | Scrapy 2.9.0. | Python 3.10.9
Solution
I found the problem and solved it. Somehow there's was copy of scrapy.cfg of 'alien_project' above all my project folder. I guess Scrapy tried to refer to that scrapy config file. I just removed it and know everything works.
Thanks for all people trying to help me!
Answered By - AuditoR
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.