I'm trying to install my Django project to my M1 Mac laptop but it is giving errors.
..OSError: dlopen(/Users/e.celik/Library/Python/3.8/lib/python/site-packages/magic/libmagic/libmagic.dylib, 0x0006): tried:
'/Users/e.celik/Library/Python/3.8/lib/python/site-packages/magic/libmagic/libmagic.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')),
'/System/Volumes/Preboot/Cryptexes/OS/Users/e.celik/Library/Python/3.8/lib/python/site-packages/magic/libmagic/libmagic.dylib' (no such file),
'/Users/e.celik/Library/Python/3.8/lib/python/site-packages/magic/libmagic/libmagic.dylib'
(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
I do not know why is this happening?
I'm using python 3.8 and last version of pip.
How can I fix that?
Related
With my Mac M1 machine, I wish to use IPython Kernels in coding softwares like VSCode and Spyder, but when importing NumPy from those Kernels, I get the following Error :
Original error was: dlopen(/PATHTOLIBRARY/Python/3.9/lib/python/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so, 0x0002): tried: '/PATHTOLIBRARY/Python/3.9/lib/python/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))
The problem seems to be associated with IPython kernels because when running the respective .py scripts on the terminal, there is no such issue.
I uploaded below a screenshot of the problem: The code (left) works on the terminal (bottom), but not on the interactive window (right).
I have seen quite a few links about this kind of issue (see below), none of which worked for me. In special, I wouldn't like to install conda on my machine.
https://github.com/nteract/hydrogen/issues/2147
https://github.com/quarto-dev/quarto-cli/issues/1133
mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64') in Flutter
In my Apple M1 chip machine, trying to import panda module in IntelliJ IDEA. while running this program its giving below error.
If I run the same program in command line, it works. Running into this problem while running in the IDE.
Any help to resolve this error message?
Code
import os
import pandas as pd
Remove my home dir from this output:
Error
Traceback (most recent call last):
File "panda-test01.py", line 9, in <module>
import pandas as pd
File "Library/Python/3.8/lib/python/site-packages/pandas/__init__.py", line 16, in <module>
raise ImportError(
ImportError: Unable to import required dependencies:
numpy:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.8 from "/Library/Developer/CommandLineTools/usr/bin/python3"
* The NumPy version is: "1.22.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: dlopen(Library/Python/3.8/lib/python/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so, 0x0002): tried: 'Library/Python/3.8/lib/python/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
Thanks
from your error message:
(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
It's a little ambiguous as it could be interpreted either way round, but I think it means that IntelliJ is running using Rosetta2 in X86 mode, whereas the numpy/pandas installation the python PATH has is your arm version. (The alternative is the reverse of this, but this way round is more likely).
In order to run your program, you'll need to create a python environment which uses Rosetta2 and installs X86 binaries instead of arm. I've written about how to do this here as a reference for myself. Then IntelliJ should have a setting somewhere to specify the python environment to use for execution and debugging, you should set that environment/PATH to your new X86 environment.
I have been trying to run my django project on my new macbook Apple M1 Chip machine but only to encounter the error below.
I have tried to ensure that arch command returns i386 on both pycharm and system terminal but still not working.
ImportError: dlopen(/Users/harmankibue/.virtualenvs/wwsb_env/lib/python3.9/site-packages/srsly/ujson/ujson.cpython-39-darwin.so, 2): no suitable image found. Did find:
/Users/harmankibue/.virtualenvs/wwsb_env/lib/python3.9/site-packages/srsly/ujson/ujson.cpython-39-darwin.so: mach-o, but wrong architecture
/Users/harmankibue/.virtualenvs/wwsb_env/lib/python3.9/site-packages/srsly/ujson/ujson.cpython-39-darwin.so: mach-o, but wrong architecture
Try this,
Go to Application folder -> Right click on Terminal App -> Get Info
Tick Open with Rosetta option.
build the project now.
I had Python 3.8.10 in my mac OS and was facing this same error after installing numpy version 1.21.x.
Reinstalling numpy with a lower version of 1.19.2 worked for me and I stopped seeing such errors.
Installing the Intel .dmg version of PyCharm solved this issue for me, after trying lots of ways all through the day
I am python new user,but after a successful installation. After execution, I have the following message:
The code execution cannot proceed because python39.dll was not found.Reinstalling he programm may fix this problem
I have tried to download 'python.dll'from wikidll.com , it is a winrar folder. After extracting the files and place them first of all in the windows system and secondly in the python installation file, I have the same problem.
How can I solve this problem?
I would not advise the downloading of dlls/exes from untrusted websites as you never know if there is any "additional payload"/malware provided with it.
Check out the latest 3.9.4 Python for Windows at
https://www.python.org/downloads/release/python-394
I just installed it on my machine and python39.dll was there :)
I didn't test the 3.9.1 installer, but if the dll is missing then it is in the "embeddable package", which can find at
https://www.python.org/downloads/release/python-391
The downloaded dll wont work because it's the wrong dll file. The missing file is python39.dll but you have downloaded python.dll which is not the same.
You need Win 8 or later to install Python 3.9.1. I hope your system has it. If you don't have then I suggest you download a compatible version.
You can find the missing dll file in the link below :
https://mega.nz/file/M2o2ARqR#tZIEd4CFIkp_MkrfNy7GbBeSl4c7P0CG3XkwpXBIJ64
If this doesn't solve the issue then I suggest you to re install python! Hope it helps.
I found several topics relating to this issue (when I try to run python.exe in command line, I get the subject error message), but none of the suggestions worked for me. I have installed and uninstalled around 5 times now. I wasn't getting this error earlier tonight after first installing, FWIW.
I am running Windows 7 64 bit. I realized that my first default 3.5.1 install was 32-bit so I uninstalled. Then I installed Windows x86-64 executable installer. I tried that twice. I switched to version 2.7.11 Windows x86-64 MSI installer. I still get this error. On the latest try (2.7.11), I ran Dependency Walker and got 3 errors:
Error: At least one required implicit or forwarded dependency was not found.
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
The first error is that python27.dll is missing. I found that in the System folder and copied it into the main folder of my install (C:\Python27) and then also tried the DLL folder. Still getting my same error. Pulling me hair out and it doesn't help that I am brand new to python in general! I am worried that the uninstalls haven't been scrubbing properly or I have otherwise messed this up.
Thanks and sorry!