2016-05-30 18 views
14

この質問はthisと似ています。pycharmのpythonコードのデバッグ

debug_app

エントリポイントがapp.pyに位置しています:私は、次のような構成でpyethapp をデバッグしようとしています。 ;クライアント

Failed to import scrypt. This is not a fatal error but does 
mean that you cannot create or decrypt privkey jsons that use 
scrypt 

/usr/local/lib/python2.7/dist-packages/cffi/model.py:526: UserWarning: 'point_conversion_form_t' has no values explicitly defined; next version will refuse to guess which integer type it is meant to be (unsigned/signed, int/long) 
    % self._get_c_name()) 
Traceback (most recent call last): 
    File "/home/user/Utils/pycharm-community-2016.1/helpers/pydev/pydevd.py", line 1530, in <module> 
    globals = debugger.run(setup['file'], None, None, is_module) 
    File "/home/user/Utils/pycharm-community-2016.1/helpers/pydev/pydevd.py", line 937, in run 
    pydev_imports.execfile(file, globals, locals) # execute the script 
    File "app.py", line 27, in <module> 
    from console_service import Console 
    File "/home/user/Utils/pycharm-community-2016.1/helpers/pydev/_pydev_bundle/pydev_monkey_qt.py", line 71, in patched_import 
    return original_import(name, *args, **kwargs) 
    File "console_service.py", line 38, in <module> 
    @inputhook_manager.register('gevent') 
AttributeError: 'InputHookManager' object has no attribute 'register' 

ソリューションはhereを提案し、デバッグ時にのみ発生する(問題を解決していない(ipython再インストール):デバッグされていないとき、私は次の例外がスローされたデバッガを起動したら、コードが正常に動作します別々に実行すると動作します)。

編集:出力の

コマンドライン:

/usr/bin/python2.7 /home/user/Utils/pycharm-community-2016.1/helpers/pydev/pydevd.py --cmd-line --multiproc --qt-support --client 127.0.0.1 --port 59087 --file app.py --profile testnet --data-dir testnetState/ run 
warning: Debugger speedups using cython not found. Run '"/usr/bin/python2.7" "/home/user/Utils/pycharm-community-2016.1/helpers/pydev/setup_cython.py" build_ext --inplace' to build. 
pydev debugger: process 20493 is connecting 

Connected to pydev debugger (build 145.260) 

Failed to import scrypt. This is not a fatal error but does 
mean that you cannot create or decrypt privkey jsons that use 
scrypt 

/usr/local/lib/python2.7/dist-packages/cffi/model.py:526: UserWarning: 'point_conversion_form_t' has no values explicitly defined; next version will refuse to guess which integer type it is meant to be (unsigned/signed, int/long) 
    % self._get_c_name()) 
Traceback (most recent call last): 
    File "/home/user/Utils/pycharm-community-2016.1/helpers/pydev/pydevd.py", line 1530, in <module> 
    globals = debugger.run(setup['file'], None, None, is_module) 
    File "/home/user/Utils/pycharm-community-2016.1/helpers/pydev/pydevd.py", line 937, in run 
    pydev_imports.execfile(file, globals, locals) # execute the script 
    File "app.py", line 27, in <module> 
    from console_service import Console 
    File "/home/user/Utils/pycharm-community-2016.1/helpers/pydev/_pydev_bundle/pydev_monkey_qt.py", line 71, in patched_import 
    return original_import(name, *args, **kwargs) 
    File "console_service.py", line 38, in <module> 
    @inputhook_manager.register('gevent') 
AttributeError: 'InputHookManager' object has no attribute 'register' 
+0

あなたのデバッグと非デバッグの設定は実際に同じバージョンのpythonを使用していますか? – pvg

+0

はい、2.7.9を使用して、スクリプトをデバッグして独立して実行しています。 – Sebi

+0

私はバージョンではなく、実際にはインストールを意味していました。 "show command line"チェックボックスをチェックしてください。 – pvg

答えて

1

このエラーは、あなたが(実際にメソッドregisterはまだ実装されなかった)IPythonの古いバージョンを使用する場合に発生することが知られています。おそらく、デフォルトのPythonインストールが含まれているOSXを使用すると、あなたの環境にいくつかのIpythonコピーが矛盾している可能性があります。

この問題は、ルートパッケージが干渉できない仮想環境にプロジェクトを移動することによって解決される可能性があります。

0

cython missing警告を取り除くために、実行します。

python2 /.......git/liclipse/plugins/org.python.pydev_6.2.0.201711281546/pysrc/setu p_cython.py build_ext --inplace 

最後に、デバッグウィンドウには、これらの恐ろしい警告と乱雑のクリーンとどまります。

関連する問題