I am having trouble running django on my M1 Mac. When ever i try to run server or make migrations i get an (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')
error.
My terminal is being open with Rosetta and I am using VSCode ide.
CodePudding user response:
You are running a version of django that might work with previous generation macs, but the M1 and M2 have different hardware which is why the version you're using is not working.
How did you install django on your M1? Do you have a guide that you followed? Here is one link I found that was pretty straightforward.
If you have any trouble following the instructions, feel free to ask!
CodePudding user response:
Your question is a bit lacking on details. I can tell you a couple things though. First, this is probably not a problem with django, but more a problem with libraries. Django is written in pure python, so it should be architecture agnostic, which means there should be no reason that it throws such an error. Make sure that you can run python from the command line with 'python --version'. It should simply give you the python version you have installed. If you instead get the same error, you have the wrong version of python installed. If you get no errors, you probably have installed some package that includes code compiled for an x86 architecture. You will have to figure out which package that is, remove it, and try installing the correct package for your architecture.
Since you don't say how you are running django, it could be something outside of python or its libraries as well. For instance, if you are attempting to run some sort of server architecture, and not running the development environment, that software could be the wrong version for the architecture as well.
If you want better answers though, you need to provide more information.