R
Railway14mo ago
0_mik_0

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
Percy14mo ago
Project ID: 64d445b5-9b8a-47fb-ae3c-c0d392283196
0_mik_0
0_mik_014mo ago
64d445b5-9b8a-47fb-ae3c-c0d392283196
Brody
Brody14mo ago
can you share your repo?
0_mik_0
0_mik_014mo ago
GitHub
GitHub - MichailoZaichenko/bike_shop
Contribute to MichailoZaichenko/bike_shop development by creating an account on GitHub.
Brody
Brody14mo 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_014mo ago
And what should I do with my requirements.txt?
Brody
Brody14mo ago
add the missing package
0_mik_0
0_mik_014mo ago
I did this with pip freeze > requirements.txt I thought that it collects all the data, isn't it?
Brody
Brody14mo ago
have you tried searching for other people who have had this error on the interwebs before?
0_mik_0
0_mik_014mo 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
Brody14mo ago
does this error happen during build logs?
0_mik_0
0_mik_014mo ago
0_mik_0
0_mik_014mo ago
0_mik_0
0_mik_014mo ago
it happened here
Brody
Brody14mo ago
are you using python 3.10 locally?
0_mik_0
0_mik_014mo ago
yes
Brody
Brody14mo ago
just an idea, set the service variable NIXPACKS_NO_CACHE = 1
0_mik_0
0_mik_014mo ago
I need to paste it in settings.py?
Brody
Brody14mo ago
no railway service variable
0_mik_0
0_mik_014mo 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
Brody14mo ago
show me the table at the top of the build log?
0_mik_0
0_mik_014mo ago
Brody
Brody14mo ago
you have already told railway to use python 3.10
0_mik_0
0_mik_014mo ago
I don`t think so How am I supposed to do that?
Brody
Brody14mo ago
you have already done it so the version is not the problem
0_mik_0
0_mik_014mo ago
mildpanic there is one oddity when I try to delete modeltranslation:
0_mik_0
0_mik_014mo ago
Brody
Brody14mo 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_014mo 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
Brody14mo 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_014mo ago
railway is built on linux?
Brody
Brody14mo ago
uh yeah Ubuntu to be specific well at least your python code runs on Ubuntu when on railway
0_mik_0
0_mik_014mo 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
Brody14mo 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_014mo ago
oh ok
Brody
Brody14mo ago
whats the biggest file you have in your repo?
0_mik_0
0_mik_014mo ago
what do you mean - file? I have some photos in my repo which are the biggest
Brody
Brody14mo ago
well there goes that idea, back to googling you go but check if the package can even run on linux