9

Not sure exactly what went wrong but after installing python3-devel I can no longer import subprocess. As a result I can't use pip or some important scripts I have written for my workflow. Here is the error I'm getting:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.6/subprocess.py", line 136, in <module>
    import _posixsubprocess
ImportError: /usr/lib64/python3.6/lib-dynload/_posixsubprocess.cpython- 
36m-x86_64-linux-gnu.so: undefined symbol: _Py_set_inheritable_async_safe

I've tried reinstall python3.6, reinstalling python3-devel, and removing python3-devel.

If it helps, I'm on OpenSUSE tumbleweed with a Lenovo Ideapad 720s Ryzen 7.

Acumenus
  • 41,481
  • 14
  • 116
  • 107
jcavejr
  • 121
  • 1
  • 7

4 Answers4

1

Same problem here with OpenSuse Leap while trying to create a virtual environment. I get the exact same error as you, updating the system does not fix it, neither is updating anaconda. Maybe this is related to an update of Opensuse that causes an error with subprocess?

[EDIT]: I solved this by removing and reinstalling anaconda. You have to make sure that no file is left behind during the uninstallation (the first time did not work for me because of that).

Acumenus
  • 41,481
  • 14
  • 116
  • 107
qmeeus
  • 1,869
  • 8
  • 18
0

Updated all of the software on my system with sudo zypper up and the problem is fixed.

jcavejr
  • 121
  • 1
  • 7
0

If this happens when importing or using a third-party package, simply uninstall and reinstall the third-party package in question. This fixed it for me. If you don't know which third-party package is relevant, uninstall and reinstall them all.

The problem is evidently not with subprocess or _posixsubprocess.

Acumenus
  • 41,481
  • 14
  • 116
  • 107
0

I had the same issue when running pipenv install.

In order to fix it, I had to remove the existing virtual env directory, e.g. sudo rm -r /home/peter/.local/share/virtualenvs/mytool-INczyaXA and then run pipenv install again.

Rotareti
  • 31,464
  • 14
  • 87
  • 93