NSight gdb error - python

I have a problem with the "pretty printer" option of IDE NSight (eclipse) when I try to debug. I have googled but I have not found a solution to my problem.
When I start to debug, appears the next message:
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21-gdb.py", line 64, in <module>
register_libstdcxx_printers(gdb.current_objfile())
File "/usr/lib/x86_64-linux-gnu/../../share/gcc-5/python/libstdcxx/v6/__init__.py", line 33, in register_libstdcxx_printers
register_libstdcxx_xmethods(obj)
File "/usr/lib/x86_64-linux-gnu/../../share/gcc-5/python/libstdcxx/v6/xmethods.py", line 600, in register_libstdcxx_xmethods
gdb.xmethod.register_xmethod_matcher(locus, ArrayMethodsMatcher())
File "/usr/share/gdb/python/gdb/xmethod.py", line 266, in register_xmethod_matcher
index = _lookup_xmethod_matcher(locus, matcher.name)
File "/usr/share/gdb/python/gdb/xmethod.py", line 236, in _lookup_xmethod_matcher
for i in range(0, len(locus.xmethods)):
AttributeError: 'gdb.Objfile' object has no attribute 'xmethods'
I'm not sure where is the problem but the variables values doesn't appear and the only solution is to disable the pretty print option.
I'm using Ubuntu 16.04 and the cuda toolkit was installed from repositories.
If anyone can help, I will be very grateful.

This sounds like a bug in your gdb installation. gdb.Objfile.xmethods is something that should be provided by the gdb core, which implements gdb.Objfile. So, examining it from /usr/share/gdb/python/gdb/xmethod.py should be ok -- because that is also a file that comes with gdb.

Related

How can I use the Tensorflow debugger in PyCharm on Mac OS X?

I am trying to use the Tensonflow debugger in PyCharm. When I do I get this error: _curses.error: setupterm: could not find terminal
Here is the full traceback:
Traceback (most recent call last):
File "/Users/mddrill/PycharmProjects/NumberReaderNN/number_reader.py", line 163, in <module>
[optimizer, loss_func, train_prediction], feed_dict=feed_dict
File "/anaconda/lib/python3.6/site-packages/tensorflow/python/debug/wrappers/framework.py", line 411, in run
self._run_call_count))
File "/anaconda/lib/python3.6/site-packages/tensorflow/python/debug/wrappers/local_cli_wrapper.py", line 210, in on_run_start
self._prep_cli_for_run_start()
File "/anaconda/lib/python3.6/site-packages/tensorflow/python/debug/wrappers/local_cli_wrapper.py", line 228, in _prep_cli_for_run_start
self._run_cli = ui_factory.get_ui(self._ui_type)
File "/anaconda/lib/python3.6/site-packages/tensorflow/python/debug/cli/ui_factory.py", line 56, in get_ui
return curses_ui.CursesUI(on_ui_exit=on_ui_exit)
File "/anaconda/lib/python3.6/site-packages/tensorflow/python/debug/cli/curses_ui.py", line 263, in __init__
self._screen_init()
File "/anaconda/lib/python3.6/site-packages/tensorflow/python/debug/cli/curses_ui.py", line 374, in _screen_init
self._stdscr = curses.initscr()
File "/anaconda/lib/python3.6/curses/__init__.py", line 30, in initscr
fd=_sys.__stdout__.fileno())
_curses.error: setupterm: could not find terminal
The debugger works if I run the code from a terminal, so this is definitely a PyCharm issue.
I have tried what I saw in another answer which is to add TERMINFO=/etc/terminfo to the environment variables in Run>Edit Configurations>Defaults>Python and that didn't work. The answer pertained to linux, and I'm on Mac OS X.
How can I get the Tensonflow debugger to work in PyCharm on Mac OS X?
UPDATE: You are right, it seems this is an open issue in PyCharm:
https://youtrack.jetbrains.com/issue/PY-13062
OLD: Tipically, you need to set the proper environment variables:
export TERM=xterm-new
export TERMINFO=/etc/terminfo
An almost identical problem has been discussed here: Setupterm could not find terminal, in Python program using curses
You could go the 'Edit Configuration' page, and select 'Emulate in output console'.

PyInstaller "You may load I/O plugins with the `skimage.io.use_plugin`"

useing Pyinstaller packages a python script
Pyinstaller version 3.2
OS:Ubuntu
Traceback (most recent call last):
File "<string>", line 57, in <module>
File "<string>", line 29, in feature_extract
File "caffe/io.py", line 295, in load_image
File "skimage/io/_io.py", line 100, in imread
File "skimage/io/manage_plugins.py", line 194, in call_plugin
RuntimeError: No suitable plugin registered for imread.
You may load I/O plugins with the `skimage.io.use_plugin` command. A list of all available plugins can be found using `skimage.io.plugins()`.
file_test returned -1
I have been getting above error. Could some one please tell me how would i fix it?
The problem seems to be related to this github issue, essentially the skimage.io._plugins submodule is making life hard for Pyinstaller.
To make sure everything you need is packaged you should have a hook file that contains
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
datas = collect_data_files("skimage.io._plugins")
hiddenimports = collect_submodules('skimage.io._plugins')
(or if you already have a hook file with these, extend the current datas and hiddenimports).

Can not run robotframework-ride properly

I have installed robotframework-ride on two PCs of mine. Everything works fine on one PC but could not have RIDE running on other PC.
I have the following installed on both PCs
- Python 2.7.8 on win32
- Robot framework 2.8.6
- wxPython 2.8.12.1
- robotframeowkr-ride-1.4.1b
When I tried to execute "python ride.py" on the second PC, I got a message:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\robotide__init__.py", line 74, in main
run(inpath, not noupdatecheck, debug_console)
File "C:\Python27\lib\site-packages\robotide__init_.py", line 100, in run
ride = RIDE(inpath, updatecheck)
File "C:\Python27\lib\site-packages\robotide\application\application.py", line
41, in __init_
wx.App.init(self, redirect=False)
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx_core.py", line 7981
, in init
self.BootstrapApp()
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx_core.py", line 7555
, in _BootstrapApp
return _core.PyApp__BootstrapApp(args, *kwargs)
File "C:\Python27\lib\site-packages\robotide\application\application.py", line
49, in OnInit
self.namespace = Namespace(self.settings)
File "C:\Python27\lib\site-packages\robotide\namespace\namespace.py", line 41,
in init
self._set_pythonpath()
File "C:\Python27\lib\site-packages\robotide\namespace\namespace.py", line 62,
in _set_pythonpath
self._settings.get('installed robot version', None))
File "C:\Python27\lib\site-packages\robotide\namespace\robotlibraryloader.py",
line 35, in find_installed_robot_libraries
rf_file, rf_version = output.strip().split(', ')
ValueError: too many values to unpack
Use --help to get usage information.
Something more interesting is, if I uninstall robot framework from the second PC, I could execute "python ride.py" but of course there is no point doing this.
Anyone can help me out here?
With kind assistance from janne, I have solved this problem. The cause is for the first PC I installed the correct "robotframework", but for the second PC I managed to install a wrong module, "robot" instead of "robotframework". That was why RIDE was not working.
I am sorry for making such a silly mistake. A big thank you to janne for his help.
should use: pip install robotframework
should NOT use: pip install robot

importing pywiiuse to test out

This is probably a simple problem. But I downloaded the pywiiuse library from here and I also downloaded the examples. However when I try to run one of the examples I end up with import issues. I'm not certain I have everything configured properly to run. One error I receive when trying to run example.py:
Press 1&2
Traceback (most recent call last):
File "example.py", line 73, in <module>
wiimotes = wiiuse.init(nmotes)
File "/home/thed0ctor/Descargas/wiiuse-0.12/wiiuse/__init__.py", line 309, in init
dll = ctypes.cdll.LoadLibrary('libwiiuse.so')
File "/usr/lib/python2.7/ctypes/__init__.py", line 431, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python2.7/ctypes/__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libwiiuse.so: cannot open shared object file: No such file or directory
I'm really just starting out with this library and don't really see any documentation on how to configure pywiiuse so any help is much appreciated.
The pywiiuse library is a Python wrapper for the wiiuse C library.
Before you can use the wrapper you will first need to install the library it wraps, choose the newest version from this download page and download the appropriate installation package for you system (probably the .tar.gz since you appear to be on Linux).
add the link of libwiiuse.so to /usr/local/lib.
I also ran into this situation, I konw why it happies, but I don't konw the deep reason.

Mercurial CGI (hgweb.cgi) fails

I have Mercurial 1.8.1, Python 2.6.6 installed on Win 2k8 R2 running on a vm. I have tried installing from msi, source and using tortisehg. Command-line Hg works fine but I get the same error when running the hgweb.cgi:
Traceback (most recent call last):
File ".\hgweb.cgi", line 17, in
application = hgweb(config)
File "mercurial\hgweb\__init__.pyc", line 26, in hgweb
File "mercurial\hgweb\hgwebdir_mod.pyc", line 61, in __init__
File "mercurial\hgweb\hgwebdir_mod.pyc", line 70, in refresh
File "mercurial\ui.pyc", line 35, in __init__
File "mercurial\demandimport.pyc", line 75, in __getattribute__
File "mercurial\demandimport.pyc", line 47, in _load
File "mercurial\util.pyc", line 576, in
File "mercurial\demandimport.pyc", line 85, in _demandimport
File "mercurial\windows.pyc", line 21, in
File "mercurial\demandimport.pyc", line 75, in __getattribute__
File "mercurial\demandimport.pyc", line 47, in _load
File "mercurial\osutil.pyc", line 12, in
File "mercurial\osutil.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.
The other answers I have found on SO and elsewhere pointed me to try installing from source, dropping the pure osutil into the install, or installing an older version. I have tried them all.
This is especially frustrating because I have other, similar non-vm machines running fine but have been unable to find the disconnect.
Ideas?
I had the same error using following system configuration
Python-2.6.6 installed as msi
mercurial-1.8.2-x86 installed as msi
IIS7
I solved this problem simply:
Python has been installed early
Uninstall Mercurial msi package
Download and install "Mercurial-1.8.2 (32-bit py2.6)" installer from mercurial website which is marked as "This is recommended for hgweb setups".
copyed content of C:\Python26\Lib\site-packages\mercurial\ to the directory used in IIS7 website setup.
Till now all is working. Hope this will help.
Whenever I have less than descriptive error messages that tell me something is going on at the system level but not what, I use Sysinternals' Procmon to tell me what's going with the registry and filesystem. It's verbose, and getting the filter to show just the process of interest takes some learning, but you can export the results to Excel and skim them for suspicious-looking results. Pay particular attention to failures, of course.
Give it a try and see what DLL is being searched for.

Categories

Resources