The issue is i am not able to migrate the changes to the db and not able to make migrations as well

20 Views Asked by At

This is the image of errorI changed from python 3.8 to 3.12.2 everything is fine but i am not able to migrate dont know why neither its making migrations. When i do python manage.py make migrations. This issue comes up:

File "/Users/mhaziq/Documents/codebase/abbi-backend-new/.venv/lib/python3.12/site-packages/simplified_scrapy/init.py", line 7, in from simplified_scrapy.simplified_main import SimplifiedMain File "/Users/mhaziq/Documents/codebase/abbi-backend-new/.venv/lib/python3.12/site-packages/simplified_scrapy/simplified_main.py", line 4, in import threading, traceback, time, importlib, imp, os, json, io ModuleNotFoundError: No module named 'imp'

Although When i go to the file package file named simplified-scrapy/simplified_main.py and change:

from imp import reload

to

from importlib import reload

the issue is resolved but its not the good thing i want a proper way for it because changeing a package file is not a good thing. please help me with it

1

There are 1 best solutions below

0
potato_cannon On

imp was deprecated long time ago, and removed in 3.12.

https://docs.python.org/3/whatsnew/changelog.html

Python 3.6.0 alpha 1
Release date: 2016-05-16

Library
Move the imp module from a PendingDeprecationWarning to DeprecationWarning.


Python 3.12.0 beta 1
Release date: 2023-05-22

Library
gh-98040: Remove the long-deprecated imp module.

Problem seems to raise from simplified-scrapy, so go raise an issue for it in github and/or open a PR with your fix. 3.11 will work as is, and you can of course keep using 3.12 with your own correction, but then you need to handle deployment by building the package from your version of source code instead of installing from pypi.