2014-01-10 3 views
1

pip-3.2를 사용하여 django-sphinx를 설치하려고하는데 구문 오류가 있습니다.django-sphinx 배터리 지원 python3

Python 3.2에서 django-sphinx를 설치하는 방법을 알려주십시오.

dpkg -i sphinxsearch_2.1.4-release-1~wheezy_amd64.deb 

를 설치 로그 :

Do not forget to reindex all indexes by running: indexer --all 

Starting sphinxsearch: Sphinx 2.1.4-id64-release (rel21-r4421) 
Copyright (c) 2001-2013, Andrew Aksyonoff 
Copyright (c) 2008-2013, Sphinx Technologies Inc (http://sphinxsearch.com) 

using config file '/etc/sphinxsearch/sphinx.conf'... 
listening on all interfaces, port=9312 
listening on all interfaces, port=9306 
precaching index 'test1' 
WARNING: index 'test1': preload: failed to open /var/lib/sphinxsearch/data/test1.sph: No such file or directory; NOT SERVING 
precaching index 'test1stemmed' 
WARNING: index 'test1stemmed': preload: failed to open /var/lib/sphinxsearch/data/test1stemmed.sph: No such file or directory; NOT SERVING 
WARNING: multiple addresses found for 'localhost', using the first one (ip=127.0.0.1) 
precaching index 'rt' 
precached 3 indexes in 0.040 sec 
sphinxsearch is started. 

후 내가 PIP-3.2 실행 스핑크스를 설치하고 장고 - 스핑크스를 설치하려고 : 로그를 설치

내가 설치 http://sphinxsearch.com/downloads/release/ 에서에서 스핑크스 DEB 패키지를 다운로드 :

Downloading/unpacking django-sphinx 
    Downloading django-sphinx-2.2.4.tar.gz 
    Running setup.py egg_info for package django-sphinx 

    warning: no previously-included files matching '*~' found anywhere in distri 
bution 
Requirement already satisfied (use --upgrade to upgrade): django in /usr/local/l 
ib/python3.2/dist-packages (from django-sphinx) 
Installing collected packages: django-sphinx 
    Running setup.py install for django-sphinx 

    warning: no previously-included files matching '*~' found anywhere in distri 
bution 
     File "/usr/local/lib/python3.2/dist-packages/djangosphinx/config.py", line 
56 
     print render_to_string(getattr(settings, 'SPHINX_CONFIG_TEMPLATE', 'conf 
/sphinx.conf'), context) 
          ^
    SyntaxError: invalid syntax 

     File "/usr/local/lib/python3.2/dist-packages/djangosphinx/apis/current.py" 
, line 5 
     except ImportError, exc: 
         ^
    SyntaxError: invalid syntax 

     File "/usr/local/lib/python3.2/dist-packages/djangosphinx/apis/api278/__in 
it__.py", line 78 
     SPH_ATTR_MULTI     = 0X40000000L 
                ^
    SyntaxError: invalid syntax 

     File "/usr/local/lib/python3.2/dist-packages/djangosphinx/apis/api275/__in 
it__.py", line 75 
     SPH_ATTR_MULTI     = 0X40000000L 
                ^
    SyntaxError: invalid syntax 

     File "/usr/local/lib/python3.2/dist-packages/djangosphinx/apis/api263/__in 
it__.py", line 119 
     except socket.error, msg: 
         ^
    SyntaxError: invalid syntax 

     File "/usr/local/lib/python3.2/dist-packages/djangosphinx/utils/config.py" 
, line 18 
     raise ValueError, "Only MySQL and PostgreSQL engines are supported by Sp 
hinx." 
         ^
    SyntaxError: invalid syntax 

     File "/usr/local/lib/python3.2/dist-packages/djangosphinx/models.py", line 
450 
     raise NotImplementedError, 'Related object and/or multiple field lookups 
not supported' 
           ^
    SyntaxError: invalid syntax 

     File "/usr/local/lib/python3.2/dist-packages/djangosphinx/management/comma 
nds/generate_sphinx_config.py", line 19 
     print generate_config_for_model(model, index) 
            ^
    SyntaxError: invalid syntax 

Successfully installed django-sphinx 
Cleaning up... 

내 문제가 : django -sphinx는 python3.X를 지원하지 않습니까? 당신이 구문 오류를 얻는 이유 https://www.djangopackages.com/grids/g/search/

+1

: 나는 장고 - 스핑크스는 파이썬 3

참조를 작동하도록 업데이트되지 않은 것 같아요. – Paolo

+0

http://pastebin.com/FXuqj9G7 설치 로그 – ijj

답변

0

하나는 try/except 구문은

파이썬 3에서는이

except ImportError as exc: 

대신

를 사용해야 파이썬 2에서 파이썬 3으로 변경한다는 것입니다
except ImportError, exc: 

우리가 보는 오류 메시지를 읽는 것은 가져 오기 구문에 관한 것이 아닙니다. 여기에는 두 버전 간의 비 호환성으로 인한 다른 문제가 있습니다. 도움이 될 오류를 추가 http://docs.python.org/3/whatsnew/3.0.html