ImportError: cannot import name 'checksum' from 'modeltranslation.models'

Hello🖐️ I just try to update my project on railway and got that: ImportError: cannot import name 'checksum' from 'modeltranslation.models' (/opt/venv/lib/python3.10/site-packages/modeltranslation/models.py) I really don't know what to do anymore So I hope for your help) id: 64d445b5-9b8a-47fb-ae3c-c0d392283196
38 Replies
Percy
Percy2y ago
Project ID: 64d445b5-9b8a-47fb-ae3c-c0d392283196
0_mik_0
0_mik_0OP2y ago
64d445b5-9b8a-47fb-ae3c-c0d392283196
Brody
Brody2y ago
can you share your repo?
0_mik_0
0_mik_0OP2y ago
GitHub
GitHub - MichailoZaichenko/bike_shop
Contribute to MichailoZaichenko/bike_shop development by creating an account on GitHub.
Brody
Brody2y ago
seems like you are just missing a dependency from your requirements.txt file also, please go and regnerate your database credentials, and going forward use environment variables, never hardcode credentials of any kind
0_mik_0
0_mik_0OP2y ago
And what should I do with my requirements.txt?
Brody
Brody2y ago
add the missing package
0_mik_0
0_mik_0OP2y ago
I did this with pip freeze > requirements.txt I thought that it collects all the data, isn't it?
Brody
Brody2y ago
have you tried searching for other people who have had this error on the interwebs before?
0_mik_0
0_mik_0OP2y ago
Yes, I found a solution to this problem on github, but it didn't work: I resolved it by deleting modeltranslation folder in env/lib/site-packages and reinstalling django-modelstranslation. If it still doesn't work try to do the same steps again but with this version #436 (comment) I tried to reinstall but nothing has changed, because the modules are installed on the server. The project is running on my computer properly. And I considered installing the modeltranslation module under Django2 a bad idea because I use Django==4.2.2
Brody
Brody2y ago
does this error happen during build logs?
0_mik_0
0_mik_0OP2y ago
0_mik_0
0_mik_0OP2y ago
0_mik_0
0_mik_0OP2y ago
it happened here
Brody
Brody2y ago
are you using python 3.10 locally?
0_mik_0
0_mik_0OP2y ago
yes
Brody
Brody2y ago
just an idea, set the service variable NIXPACKS_NO_CACHE = 1
0_mik_0
0_mik_0OP2y ago
I need to paste it in settings.py?
Brody
Brody2y ago
no railway service variable
0_mik_0
0_mik_0OP2y ago
ok I got the same error i saw it in another thread was talking about runtime.txt What is it and do i need it?
Brody
Brody2y ago
show me the table at the top of the build log?
0_mik_0
0_mik_0OP2y ago
Brody
Brody2y ago
you have already told railway to use python 3.10
0_mik_0
0_mik_0OP2y ago
I don`t think so How am I supposed to do that?
Brody
Brody2y ago
you have already done it so the version is not the problem
0_mik_0
0_mik_0OP2y ago
mildpanic there is one oddity when I try to delete modeltranslation:
0_mik_0
0_mik_0OP2y ago
Brody
Brody2y ago
that's locally, that has nothing to do with what railway is doing I will say, I'm stumped
0_mik_0
0_mik_0OP2y ago
Today I tried to upload this code on render(it like railway) and got same issue So I really don't know what to do anymore
Brody
Brody2y ago
well we know it's not a railway specific issue, so uh do more googling? or maybe that package simply isn't compatible with Linux?
0_mik_0
0_mik_0OP2y ago
railway is built on linux?
Brody
Brody2y ago
uh yeah Ubuntu to be specific well at least your python code runs on Ubuntu when on railway
0_mik_0
0_mik_0OP2y ago
I also wanted to ask how to transfer all my data from db.sqlite3 to PostgreSQL? I found a solution to this problem but I'm afraid that all data is deleted: Next, delete all migration files and create a new migration file for each application. The following command will allow you to delete the old migration files: find. -path “/migrations/.py” -not -name “init.py” -delete find. -path “/migrations/.pyc” -delete do python manage.py makemigrations python manage.py migrate
Brody
Brody2y ago
I don't see what that has to do with the error you are seeing one thing at a time
0_mik_0
0_mik_0OP2y ago
oh ok
Brody
Brody2y ago
whats the biggest file you have in your repo?
0_mik_0
0_mik_0OP2y ago
what do you mean - file? I have some photos in my repo which are the biggest
Brody
Brody2y ago
well there goes that idea, back to googling you go but check if the package can even run on linux
Want results from more Discord servers?
Add your server