spyder 3.2.8 crashes on launch with (clean conda install of) Python 3.6.5 on MacOS 10.12.6

Created on 1 Apr 2018  路  16Comments  路  Source: spyder-ide/spyder

Problem Description

spyder, on MacOS 10.12.6 with Python 3.6.5, crashes on attempt to launch from Anaconda or from commandline in conda env with error message including:
ImportError: dlopen(/Users/stuartswerdloff/anaconda2/envs/py36/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so, 2): Symbol not found: __Py_set_inheritable_async_safe

however:
nm -g _posixsubprocess.cpython-36m-darwin.so
includes:
U __Py_set_inheritable_async_safe

exact same procedure with python 3.5.5 works fine (which is what I did after the python 3.6.5 install didn't work out so well)

What steps will reproduce the problem?

  1. install Python 3.6.5 using conda (naming environment py36)
  2. activate in anaconda (conda activate ...)
  3. use anaconda to install spyder
  4. launch spyder

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

expect: spyder UI
see: traceback message, see below

Paste Traceback/Error Below (if applicable)

PASTE TRACEBACK HERE
Traceback (most recent call last):
  File "/Users/stuartswerdloff/anaconda2/envs/py36/bin/spyder", line 7, in <module>
    from spyder.app.start import main
  File "/Users/stuartswerdloff/anaconda2/envs/py36/lib/python3.6/site-packages/spyder/app/start.py", line 27, in <module>
    from spyder.config.main import CONF
  File "/Users/stuartswerdloff/anaconda2/envs/py36/lib/python3.6/site-packages/spyder/config/main.py", line 22, in <module>
    from spyder.config.user import UserConfig
  File "/Users/stuartswerdloff/anaconda2/envs/py36/lib/python3.6/site-packages/spyder/config/user.py", line 26, in <module>
    from spyder.utils.programs import check_version
  File "/Users/stuartswerdloff/anaconda2/envs/py36/lib/python3.6/site-packages/spyder/utils/programs.py", line 18, in <module>
    import subprocess
  File "/Users/stuartswerdloff/anaconda2/envs/py36/lib/python3.6/subprocess.py", line 136, in <module>
    import _posixsubprocess
ImportError: dlopen(/Users/stuartswerdloff/anaconda2/envs/py36/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so, 2): Symbol not found: __Py_set_inheritable_async_safe
  Referenced from: /Users/stuartswerdloff/anaconda2/envs/py36/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so
  Expected in: flat namespace
 in /Users/stuartswerdloff/anaconda2/envs/py36/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so

Package Versions

  • Spyder: 3.2.8
  • Python: 3.6.5
  • Qt: 5.6.2
  • PyQt: 5.6.0
  • Operating System: MacOS 10.12.6

Dependencies

PASTE DEPENDENCIES HERE
NotSpyder

Most helpful comment

The real solution is to run in Terminal.app

conda update python python.app

All 16 comments

And the donation site is not working well (from MacOS 10.12.6, using Firefox, Chrome, or Safari) so I can't even do the right thing trying to help that way...

The problem is not really in Spyder, but in Python itself, so there's nothing we can do to help. Are you able to do

import subprocess

in a Python interpreter run in a terminal?

Also, if you need a temporary fix, the same problem was reported in #6867 and the user solved it by downgrading Python to 3.6.4.

I was able to

import subprocess
in a terminal (Python 3.6.5)

downgrading to 3.6.4 worked.

contributing from an MS Windows 7 PC using Chrome worked

Great!

Same problem for me, and same solution of downgrading from Python 3.6.5 to Python 3.6.4

The real solution is to run in Terminal.app

conda update python python.app

yes, works with that.

@ccordoba12 updating python and python.app didn't help me. still get this error when I launch
```
Spyder:
Traceback (most recent call last):
File "/Users/mohamad/anaconda3/bin/spyder", line 7, in
from spyder.app.start import main
File "/Users/mohamad/anaconda3/lib/python3.6/site-packages/spyder/app/start.py", line 26, in
from spyder.config.main import CONF
File "/Users/mohamad/anaconda3/lib/python3.6/site-packages/spyder/config/main.py", line 22, in
from spyder.config.user import UserConfig
File "/Users/mohamad/anaconda3/lib/python3.6/site-packages/spyder/config/user.py", line 26, in
from spyder.utils.programs import check_version
File "/Users/mohamad/anaconda3/lib/python3.6/site-packages/spyder/utils/programs.py", line 18, in
import subprocess
File "/Users/mohamad/anaconda3/lib/python3.6/subprocess.py", line 136, in
import _posixsubprocess
ImportError: dlopen(/Users/mohamad/anaconda3/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so, 2): Symbol not found: __Py_set_inheritable_async_safe
Referenced from: /Users/mohamad/anaconda3/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so
Expected in: flat namespace
in /Users/mohamad/anaconda3/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so

```

@SeyedMohamadMoosavi Open a Terminal, and try to launch Spyder from there with spyder. If you get the same error, post the output of conda list python and conda list spyder here. Thanks.

the output of conda list python:

# packages in environment at /anaconda3:
#
# Name                    Version                   Build  Channel
ipython                   7.2.0            py37h39e3cac_0  
ipython_genutils          0.2.0                    py37_0  
msgpack-python            0.5.6            py37h04f5b5a_1  
python                    3.7.2                haf84260_0  
python-dateutil           2.7.5                    py37_0  
python-libarchive-c       2.8                      py37_6  
python.app                2                        py37_9  

and conda list spyder:

# packages in environment at /anaconda3:
#
# Name                    Version                   Build  Channel
spyder-kernels            0.4.2                    py37_0  

@SeyedMohamadMoosavi Based on what you provided, no spyder package is present in that environment, and so assuming that is the case, you must be launching a version from another environment (and of course, you need to update the python and python.app of the environment you're launching Spyder from). Did you not

Open a Terminal, and try to launch Spyder from there with spyder

Like I explicitly asked? Run which spyder and post the results here.

I did what you asked. I run Spyder from terminal and that's the error I get. I also update python and python.app from the same terminal which I suppose has the same environment.
Sorry for my ignorance and thanks for your help.

When I launch spyder from terminal:

seyeds-mbp:~ mohamad$ spyder
Traceback (most recent call last):
  File "/Users/mohamad/anaconda3/bin/spyder", line 7, in <module>
    from spyder.app.start import main
  File "/Users/mohamad/anaconda3/lib/python3.6/site-packages/spyder/app/start.py", line 26, in <module>
    from spyder.config.main import CONF
  File "/Users/mohamad/anaconda3/lib/python3.6/site-packages/spyder/config/main.py", line 22, in <module>
    from spyder.config.user import UserConfig
  File "/Users/mohamad/anaconda3/lib/python3.6/site-packages/spyder/config/user.py", line 26, in <module>
    from spyder.utils.programs import check_version
  File "/Users/mohamad/anaconda3/lib/python3.6/site-packages/spyder/utils/programs.py", line 18, in <module>
    import subprocess
  File "/Users/mohamad/anaconda3/lib/python3.6/subprocess.py", line 136, in <module>
    import _posixsubprocess
ImportError: dlopen(/Users/mohamad/anaconda3/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so, 2): Symbol not found: __Py_set_inheritable_async_safe
  Referenced from: /Users/mohamad/anaconda3/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so
  Expected in: flat namespace
 in /Users/mohamad/anaconda3/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so

and the command which spyder

seyeds-mbp:~ mohamad$ which spyder
/Users/mohamad/anaconda3/bin/spyder

Ok, found the issue! I was deactivating my Conda environment in the bash_profile and therefore even with updates, I was not using the updated version. Problem resolved.

@SeyedMohamadMoosavi Glad you figured it out! I figured something like that was very likely to be the case, given the error remained the same and we had no other reports of it persisting over nearly a year since the fix was out, but I wasn't sure what. Best of luck and happy Spydering!

The real solution is to run in Terminal.app

conda update python python.app

This worked for me too

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ckaldemeyer picture ckaldemeyer  路  48Comments

andreperesnl picture andreperesnl  路  128Comments

Khris777 picture Khris777  路  78Comments

jdweaver picture jdweaver  路  77Comments

Rojj picture Rojj  路  113Comments