Issue
My code uses matplotlib which requires numpy. I'm using pipenv as my environment. When I run the code through my terminal and pipenv shell, it executes without a problem. I've just installed Pycharm for Apple silicon (I have an M1) and set up my interpreter to use the same pipenv environment that I configured earlier. However, when I try to run it through Pycharm (even the terminal in pycharm), it throws me the following error:
Original error was: dlopen(/Users/s/.local/share/virtualenvs/CS_156-UWxYg3KY/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so, 0x0002): tried: '/Users/s/.local/share/virtualenvs/CS_156-UWxYg3KY/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
What's confusing me is the fact that my code executes when using this same environment through the my terminal... But it fails when running on Pycharm? Any insights appreciated!
Solution
I'm not sure what the problem is, but it seems to be related to the fact that you're using a different architecture (x86_64) than what's required (arm64e). Try setting your Pycharm interpreter to use the same architecture as your terminal (arm64e) and see if that fixes the problem.
Answered By - Mohamed Elgazar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.