spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.33k stars 1.61k forks source link

Spyder fails to open using Anaconda on Mac OS #22346

Closed Expodia closed 2 months ago

Expodia commented 2 months ago

Hello everyone, I am having an error when opening Spyder on MacOS, the error reads as follows "Application launch spyder may have produced some errors: /opt/anaconda3/bin/pythonw: line 3: 3639 Segmentation fault: 11 /opt/anaconda3/python.app/Contents/MacOS/python "$@".

I have read other threads around this problem and have tried all of the suggested including the conda prompts, reinstalled anaconda several times etc... however nothing has fixed this for me.

Spyder version: 5.5.1 Python version: 3.12.4 Operating System: MacOS 14.5 CPU: M1 Pro

UltorXbt commented 2 months ago

I came here seeking the answer to this exact problem.

UltorXbt commented 2 months ago

I just found a way around it. This is a reference to a thread about this same issue

Essentially @mrclary had the answer to the issue.

Copy the line of code below to your mac terminal (I altered the original code by removing (base) >> and respecifying the spider model from 5.5.5 to 5.5.1)

conda create -n spy-env -c conda-forge --override-channels python=3.12 spyder=5.5.1

You'll be asked to download a new environment. Do it. It's not much. After a minute or two, all files should be downloaded.

Restart anaconda navigator, Look to the top of your screen where you see "base(root)". Click on it, then switch to spy-env. Voila! That's it.

Screenshot 2024-08-14 at 04 45 21

You should now be able to open spyder without encountering any problems.

mrclary commented 2 months ago

Thanks, @UltorXbt.

Expodia commented 2 months ago

Thank you I can confirm this works.

May I also ask about installing packages, for example anaconda comes already with 'pandas', however now when I use this channel I get an error to say 'no module named pandas'.

mrclary commented 2 months ago

pandas must be installed into the new spy-env environment you created. You may want other packages as well, such as matplotlib and scipy, etc.

conda install -n spy-env -c conda-forge --override-channels pandas matplotlib scipy
Expodia commented 2 months ago

Excellent thanks for all your help!