I am trying to deploy my webapp that takes a name and gives it to my scrapy spider. The webapp seems to run, but when you actually make it run, an error occurs:
2023-04-18 10:11:45 Traceback (most recent call last):
2023-04-18 10:11:45 File "/home/AZServices/.virtualenvs/venv/bin/scrapy", line 8, in <module>
2023-04-18 10:11:45 sys.exit(execute())
2023-04-18 10:11:45 File "/home/AZServices/.virtualenvs/venv/lib/python3.10/site-packages/scrapy/cmdline.py", line 125, in execute
2023-04-18 10:11:45 settings = get_project_settings()
2023-04-18 10:11:45 File "/home/AZServices/.virtualenvs/venv/lib/python3.10/site-packages/scrapy/utils/project.py", line 71, in get_project_settings
2023-04-18 10:11:45 settings.setmodule(settings_module_path, priority="project")
2023-04-18 10:11:45 File "/home/AZServices/.virtualenvs/venv/lib/python3.10/site-packages/scrapy/settings/__init__.py", line 316, in setmodule
2023-04-18 10:11:45 module = import_module(module)
2023-04-18 10:11:45 File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
2023-04-18 10:11:45 return _bootstrap._gcd_import(name[level:], package, level)
2023-04-18 10:11:45 File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
2023-04-18 10:11:45 File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
2023-04-18 10:11:45 File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
2023-04-18 10:11:45 File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2023-04-18 10:11:45 File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
2023-04-18 10:11:45 File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
2023-04-18 10:11:45 File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
2023-04-18 10:11:45 ModuleNotFoundError: No module named 'scraperra'
My project directory is as follows:
AZServices
.cache/
.local/
.virtualenvs/
webapp_bullit/
.git/
.idea/
mysite/
mysite/
settings.py
wsgi.py
morefiles...
scraperra/
spiders/
website/
dbsqlite3
manage.py
output.xlsx
virt/
.bashrc
morefiles....
I haven't included all files since... well.... that would take ages, but I think these are the relevant files. In my wsgi I have the following:
path = '/home/AZServices/webapp_bullit/mysite'
if path not in sys.path:
sys.path.insert(0, path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
os.environ["PATH"] = "/home/AZServices/.virtualenvs/venv/bin/" + os.pathsep + os.environ["PATH"]
Where this last line is to solve the error where it wouldn't find the module scrapy.
Can anybody help me importing this module 'scraperra'?