14

This question is similar to this one. I am trying to debug pyethapp with the following configuration:

debug_app

The entry point is located in app.py. The code runs fine when not being debugged, but once I launch the debugger the following exception is thrown:

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'

The solution suggested here (reinstalling ipython) did not solve the issue (it occurs only when debugging; the client works when run separately).

Edit:

Command line in output:

/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'
Community
  • 1
  • 1
Sebi
  • 4,262
  • 13
  • 60
  • 116
  • You sure your debug and non-debug configs actually use the same version of python? – pvg May 30 '16 at 14:16
  • Yes, I am using 2.7.9 to debug and to run the script independently. – Sebi May 30 '16 at 14:18
  • I meant install, really, rather than version. Perhaps check that 'show command line' checkbox. – pvg May 30 '16 at 14:22
  • Added the output after checking the checkbox. – Sebi May 30 '16 at 14:31
  • in your script parameters shouldn't it be --datadir instead of --data-dir? I doubt it changes anything but never know – euri10 May 31 '16 at 17:57
  • pyethapp --help shows that the parameter should be given as "-d, --data-dir TEXT data directory [default:" – Sebi May 31 '16 at 17:59
  • I'm having the same issue- did you manage to fix it? – 4gn3s Jun 22 '16 at 12:33
  • are you also debugging pyethapp? – Sebi Jun 22 '16 at 13:39
  • I was trying to debug Hydrachain, which is build on top of pyethapp. Have you found a solution? There is an issue in github: https://github.com/ethereum/pyethapp/issues/88#issuecomment-178521465 but it didn't help me – 4gn3s Aug 11 '16 at 12:46
  • Are you using a virtualenv? If so, you might want to look at [Adding Existing Virtual Environment](https://www.jetbrains.com/help/pycharm/2016.2/adding-existing-virtual-environment.html). –  Dec 08 '16 at 18:19
  • @Sebi https://blog.jetbrains.com/pycharm/2012/08/gevent-debug-support/ you checked this ? – Renjith Thankachan Jun 08 '17 at 08:44
  • 2
    This error is known to happen if you use old versions of IPython (in which indeed the method "register" was not yet implemented). As you presumably use OSX, in which a default Python install is included, there might be some conflicting Ipython copies in your environment, different versions of which are called by the regular and debugging configurations? This problem is probably resolved by moving the project to a virtual environment in which your root packages cannot interfere. – Uvar Jul 07 '17 at 08:13
  • @Uvar I believe you should turn your _long_ comment into an answer. – m-ric Jul 10 '17 at 21:08

2 Answers2

1

This error is known to happen if you use old versions of IPython (in which indeed the method register was not yet implemented). As you presumably use OSX, in which a default Python install is included, there might be some conflicting Ipython copies in your environment, different versions of which are called by the regular and debugging configurations?

This problem is probably resolved by moving the project to a virtual environment in which your root packages cannot interfere.

Uvar
  • 3,372
  • 12
  • 25
0

To get rid of cython missing warning, run:

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

Finally the debug window stay clean of those dreaded warnings and cluttering.

clemens
  • 16,716
  • 11
  • 50
  • 65
dotbit
  • 4,445
  • 1
  • 7
  • 8