spyder-ide / spyder

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

cannot open spyder on Anaconda #22144

Open booc24 opened 2 months ago

booc24 commented 2 months ago

Issue Report Checklist

Problem Description

What steps reproduce the problem?

What is the expected output? What do you see instead?

Paste Traceback/Error Below (if applicable)


PASTE TRACEBACK HERE

Versions

Dependencies

PASTE DEPENDENCIES HERE

/opt/anaconda3/bin/pythonw: line 3: 51257 Segmentation fault: 11 /opt/anaconda3/python.app/Contents/MacOS/python "$@"

booc24 commented 2 months ago

spyder-env) CHANGs-MacBook-Pro:~ changbowen$ spyder
/opt/anaconda3/envs/spyder-env/bin/pythonw: line 3: 50508 Segmentation fault: 11 /opt/anaconda3/envs/spyder-env/python.app/Contents/MacOS/python "$@"

booc24 commented 2 months ago

Already tried everything

ccordoba12 commented 2 months ago

Hey @booc24, thanks for reporting. Please try this to see if it helps:

conda install -f python.app

Let us know if that solves your problem.

peter930736 commented 1 month ago

There is still a problem after installing python.app ❯ spyder /opt/anaconda3/envs/env1/bin/pythonw: line 3: 29705 Segmentation fault: 11 /opt/anaconda3/envs/env1/python.app/Contents/MacOS/python "$@"

ccordoba12 commented 1 month ago

Then you can try to run

conda remove --force python.app

and after that

conda install python.app

to see if that solves the problem.

Mitternacht commented 1 month ago

@ccordoba12 I have the same issue. Brand new device (MacBook Pro M3 Max with the latest MacOS) with a freshly installed Anaconda Distro (today, 28th June 2024). The previously suggested solutions have not resolved the issue for me. The only thing that works is to create a new environment with Spyder 5.4.3, instead of 5.5.1.

ccordoba12 commented 1 month ago

@mrclary, could you check this in your Mac? For that, please download the latest Anaconda and check if Spyder works for you in your computer after installing it.

mrclary commented 1 month ago

I gather from the above comments:

Has anyone tried the latest version, Spyder 5.5.5?

I'll poke around and report back.

mrclary commented 1 month ago

Okay, this issue only affects arm64 and python.app=3 (though I have not tested python.app=2).

I recommend creating a dedicated Spyder environment using the conda-forge channel:

(base) >> conda create -n spy-env -c conda-forge --override-channels python=3.12 spyder=5.5.5

This will install Python 3.12 and Spyder 5.5.5, but you can specify whichever Python or Spyder version you like by modifying the command accordingly. python.app=1.4 from conda-forge will be installed and Spyder should launch successfully.

I do not recommend installing python.app=1.4 into your Anaconda base environment or other existing environments that are created with packages from the main channel. Doing so will cause Python 3.12 to be reinstalled from the conda-forge channel and result in a mixed channel environment which may cause other issues.

ccordoba12 commented 1 month ago

Okay, this issue only affects arm64 and python.app=3 (though I have not tested python.app=2)

Thanks for checking this @mrclary! So python-app=2 works well for Python 3.8 to 3.11 in M1 Macs?

mrclary commented 1 month ago

Spyder=5.5.1 + Python=3.9.19 + python.app=2 on M1 works fine. Spyder=5.5.1 + Python=3.11.9 + python.app=2 on M1 does not work:

Traceback (most recent call last):
  File "/Users/ryan/.conda/envs/spy551_py311_defaults/bin/spyder", line 7, in <module>
    from spyder.app.start import main
  File "/Users/ryan/.conda/envs/spy551_py311_defaults/lib/python3.11/site-packages/spyder/app/start.py", line 28, in <module>
    import random
  File "/Users/ryan/.conda/envs/spy551_py311_defaults/lib/python3.11/random.py", line 49, in <module>
    from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
ImportError: dlopen(/Users/ryan/.conda/envs/spy551_py311_defaults/lib/python3.11/lib-dynload/math.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '__PyModule_Add'

Though I don't think this has anything to do with python.app=2. It appears something may be wrong with the python 3.11.9 build from the defaults channel.

ccordoba12 commented 1 month ago

@mrclary, and are there also startup errors with Python 3.12 from the defaults channel?

mrclary commented 1 month ago

@mrclary, and are there also startup errors with Python 3.12 from the defaults channel?

Yes, due to python.app=3. This is the condition for the original post.

mrclary commented 1 month ago

On the defaults channel for arm64:

Thus, is seems that the only working configuration on arm64 using defaults channel is Python 3.8 or 3.9 with python.app=2. I have found no issues with any configuration using the conda-forge channel.

VanniPham commented 4 days ago

@ccordoba12 I have the same issue. Brand new device (MacBook Pro M3 Max with the latest MacOS) with a freshly installed Anaconda Distro (today, 28th June 2024). The previously suggested solutions have not resolved the issue for me. The only thing that works is to create a new environment with Spyder 5.4.3, instead of 5.5.1.

This actually works for me. I'm using a Mac M1. Thank you!