7

In python, If I try to import setproctitle I get the following import error:

 ImportError: dlopen(/Users/xxx/.local/share/virtualenvs/airflow_gg-F_Vv1Po_/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so, 2): Symbol not found: _Py_GetArgcArgv
      Referenced from: /Users/xxx/.local/share/virtualenvs/airflow_gg-F_Vv1Po_/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so
      Expected in: flat namespace
 in /Users/xxx/.local/share/virtualenvs/airflow_gg-F_Vv1Po_/lib/python3.7/site-packages/setproctitle.cpython-37m-darwin.so

What I have tried so far:

  • Try to reinstall it (with different flags such as --upgrade and --no-cache)
  • Try to use both venv and Pipenv

Info on my system: System version: macOS 10.15.2 (19C57), Kernel version: Darwin 19.2.0

I did not manage to find any information online for this specific import error. Any ideas?

--- Edit

I installed python 3.8 from the official website and, indeed, it works (with that interpreter as base for venv). I previously had python 3.7 installed with brew (brew install python3). I do not know why it did not work.

arocketman
  • 1,134
  • 12
  • 21

1 Answers1

3

Works fine for Python 3.8 installed directly from Python page.

> python3.8 -m pip install virtualenv
> python3.8 -m virtualenv -p \
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 proctest
> source proctest/bin/activate
> python3.8 -m pip install setproctitle
> python3.8
...
...
>>> import setproctitle
>>>
Oo.oO
  • 12,464
  • 3
  • 23
  • 45
  • 1
    I have python installed from brew, I will try to use python from official website and report back. – arocketman Feb 10 '20 at 10:30
  • 1
    I installed python 3.8 from the official website and, indeed, it works (with that interpreter as base for venv). I previously had python 3.7 installed with brew (brew install python3). I do not know why it did not work. – arocketman Feb 10 '20 at 10:38
  • 1
    I had the issue on 3.8.2. Upgrading to Python 3.8.5 and re-installing airflow did it for me. – John David Five Oct 17 '20 at 16:16
  • reinstall python3.8 from official website works. – buxizhizhoum Jun 22 '21 at 05:19
  • @JohnDavidFive thanks for that! I am on Python 3.8.2 facing the exact same issue. I have the feeling it might be due to this version. However, I am unable to just download `Python 3.8.2` from python.org to validate it's due to the version. I can also imagine it's because of it being the default interpreter from my XCode. – Jorrick Sleijster Oct 06 '21 at 07:54