Illegal instruction: 4 when running Django

前端 未结 3 2042
-上瘾入骨i
-上瘾入骨i 2020-12-22 04:16

I made clean install of Django v1.11.10 now. When I run python manage.py runserver everything works fine. But when I try connect to Postgres database, I install

3条回答
  •  情歌与酒
    2020-12-22 04:51

    Blender's answer and this other question pointed to the problem, but when running the suggested command, I was getting the following error:

     Error: pg_config executable not found.
    
        pg_config is required to build psycopg2 from source.  Please add the directory
        containing pg_config to the $PATH or specify the full executable path with the
        option:
    
            python setup.py build_ext --pg-config /path/to/pg_config build ...
    
        or with the pg_config option in 'setup.cfg'.
    

    As I have no clue about settings, configurations and so on, it took a while to find out how to do it. Here it is in case somebody else faces the same issue:

    pip uninstall psycopg2
    

    then

    export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin/
    

    then

    pip install --no-binary :all: psycopg2
    

    This solved the problem for me.

提交回复
热议问题