3

While trying to run scrapy spider in docker-debian every time I get an error:

File "/usr/local/lib/python3.6/site-packages/scrapy/crawler.py", line 82, in crawl yield self.engine.open_spider(self.spider, start_requests) builtins.ModuleNotFoundError: No module named '_sqlite3'

python version 3.6.3

scrapy 1.6.0

tried instruction from this post - ImportError: No module named '_sqlite3' in python3.3 still see this error.

when type sqlite3 command in terminal it shows sqlite3 version and start sqlite terminal. SQLite version 3.16.2 2017-01-06

when type python and write next command in terminal:

import sqlite3

get this error:

ModuleNotFoundError: No module named '_sqlite3'

is there any way to solve this problem? looks like there is some misconfiguration but I can't find where it's

Roman
  • 1,883
  • 2
  • 14
  • 26

2 Answers2

1

I have the same error with sqlite3 while I was trying to start my crawler using scrapy crawl my-crawler, after some searches and tried out different solutions, I found this answer useful to my error. Just remember that you need to download your specific python version, mine was 3.8.1 and it worked thanks to their answer. I have already install sqlite3 using sudo apt install libsqlite3-dev. Hope it works in your case, too. So, at first install it then reconfigure your python via instructions in the link.

ramin_b
  • 63
  • 6
0

I had same problem in centos, I just fix it. I install multiple python version in pyenv, so I switch the python version from 3.6 to 3.4.1, then problem solved.Maybe the problem was caused by pyenv,or it's python version's problem. If you don't have pyenv,maybe you need to reinstall python,or install a diffrent version of python.Hope be helpful.

q jx
  • 1
  • 1