Qt Creator failed to start Debugger - python

Qt c++ project build under Qt Creator 3.4.1 successfully. But when I just can't launch the debugger. Output in the application Output:
Debuging starts
Debuging has failed
Debuging has finished
The debugger never really starts.
output in the terminal :
QProcess: Destroyed while process ("/usr/local/bin/gdb") is still running.
Unexpected GDB stderr: "Python Exception <type 'exceptions.ImportError'> No module named gdb:
/usr/local/bin/gdb: warning:
Could not load the Python gdb module from `/usr/local/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.
"
Warning: HANDLE RUNCONTROL START FAILED (no active run control)
Warning: State changed from EngineSetupFailed(2) to DebuggerFinished(23) [master] (no active run control)
Warning: (gdb) (no active run control)
Warning: 48^done (no active run control)
Warning: (gdb) (no active run control)
Warning: UNEXPECTED GDB STDERR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/Qt5.4.2/Tools/QtCreator/share/qtcreator/debugger/gdbbridge.py", line 20, in <module>
from dumper import *
File "/opt/Qt5.4.2/Tools/QtCreator/share/qtcreator/debugger/dumper.py", line 37, in <module>
import importlib
ImportError: No module named importlib
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'theDumper' is not defined
(no active run control)
Unexpected GDB stderr: "Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/Qt5.4.2/Tools/QtCreator/share/qtcreator/debugger/gdbbridge.py", line 20, in <module>
from dumper import *
File "/opt/Qt5.4.2/Tools/QtCreator/share/qtcreator/debugger/dumper.py", line 37, in <module>
import importlib
ImportError: No module named importlib
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'theDumper' is not defined
"
Warning: QUIT DEBUGGER REQUESTED IN STATE 23 (no active run control)
More information:
gcc used by qt creator : version 5.0.1
gdb used by qt creator : version 7.9
python 2.6.6 installed on my CentOS 6.5 ,and is in PATH .
when I install gdb wiht source code I did not append --with-python option. I googled out that someone did build with that option but nothing happens.

The outputs in terminal exposed two issues:
the ImportError: No module named importlib leads to unsupported library in Python. So install new version of Python (greater than 2.7) as #Amartel said.But the in my situation the gdb needs to be rebuild with --with-python configuration option to make gdb use newer version of Python.
Python Exception <type 'exceptions.ImportError'> No module named gdb:
/usr/local/bin/gdb' can been solved by copy files in the directory: gdb_src_dir/gdb/data-directory/python/gdb to /usr/local/share/gdb. NOTE: my gdb is installed under/usr/local/bin.
Finally, the debugger works all fine.
However, I did not get the reason for issues 2. Any one can explain that?

Related

julia.install() fails on python import error

I am trying to run a Julia script from python. I have Julia 1.6.4 installed (also tried 1.7.3) and installed pip install julia from Pycharm's terminal in the virtual environment. When importing julia and then running julia.install() I get the following error message:
I use Pycharm with a virtual environment with Python 3.9.7 for my project. However, I have also tried different python versions in different virtual environments or by using the base python installed. All give the same error.
Also, ~/.julia/packages/PyCall/*/deps/build.log does not exist for me.
[ Info: Trying to import PyCall...
Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\site.py", line 73, in <module>
import os
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\os.py", line 29, in <module>
from _collections_abc import _check_methods
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\_collections_abc.py", line 12, in <module>
GenericAlias = type(list[int])
TypeError: 'type' object is not subscriptable
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Users\<user>\PycharmProjects\<project>\venv\lib\site-packages\julia\tools.py", line 118, in install
raise PyCallInstallError("Installing", output)
julia.tools.PyCallInstallError: Installing PyCall failed.
** Important information from Julia may be printed before Python's Traceback **
Some useful information may also be stored in the build log file
`~/.julia/packages/PyCall/*/deps/build.log`.```
Julia needs to have PyCall installed
PyCall in Julia needs to be configured to use the same Python that you are using to call Julia from
For more information see this post:
I have a high-performant function written in Julia, how can I use it from Python?

Run Python scripts on Jenkins

I am trying to run my python automation on Jenkins. The scripts can be started on local PC. I already pip install 'request'. But when I try to start the scripts on Jenkins, it shows:
Building in workspace C:\Users\Desktop\Automation\CGN_automation
[CGN_automation] $ cmd /c call C:\Windows\TEMP\jenkins401971882258893188.bat
C:\Users\Desktop\Automation\CGN_automation>python testCase_100_856451.py
Traceback (most recent call last):
File "testCase_100_856451.py", line 9, in <module>
from cgnTestLib import *
File "C:\Users\Desktop\Automation\CGN_automation\cgnTestLib.py", line 2,
in <module>
import requests
ModuleNotFoundError: No module named 'requests'
C:\Users\Desktop\Automation\CGN_automation>exit 1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

How to reinstall or fix Python interpreter for XCode lldb?

I got this message at XCode after deleting some system files.
(lldb) script
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_python_interpreter' is not defined
P.S. Had to reinstall XCode, but I've got same message at debugger after reinstalling IDE
Terminal output
$ lldb
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 52, in <module>
import weakref
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.py", line 14, in <module>
from _weakref import (
ImportError: cannot import name _remove_dead_weakref
You have a local installation of python on your computer (in /usr/local/Cellar). There's a problem when you have two different pythons on your system; lldb links against /System/Library/Frameworks/Python.framework but that python somehow ends up using the python libraries from your installed copy instead. I saw someone work around this once but I forget if it was by putting their local python last in $PATH or if they un-set their $PYTHONPATH before starting lldb.

"Name Error: name 'get_ipython' is not defined" while preparing a debugging session via "import ipdb"

I'm trying to install and use ipdb (IPython-enabled pdb) on Python 3.3.5 32 bit on Win10 using PIP 8.1.2.
I've installed via PIP (had to install it seprately) in windows cmd with no errors:
pip install ipdb
I wrote a simple test script expecting to stop in debugger before printing 'test' string, ipdb_test.py:
import ipdb
ipdb.set_trace()
print('test')
When running it from IDLE editor the following exceptions show up:
Traceback (most recent call last):
File "C:\Python33.5-32\lib\site-packages\ipdb\__main__.py", line 44, in <module>
get_ipython
NameError: name 'get_ipython' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/temp/ipdb_test.py", line 1, in <module>
import ipdb
File "C:\Python33.5-32\lib\site-packages\ipdb\__init__.py", line 7, in <module>
from ipdb.__main__ import set_trace, post_mortem, pm, run # noqa
File "C:\Python33.5-32\lib\site-packages\ipdb\__main__.py", line 51, in <module>
(...)
File "C:\Python33.5-32\lib\site-packages\prompt_toolkit\terminal\win32_output.py", line 266, in flush
self.stdout.flush()
AttributeError: 'NoneType' object has no attribute 'flush'
As the issue seemed to be related to IPython, I've checked that the version installed while resolving ipdb dependencies was: "ipython-5.1.0".
The WA solution for the issue occured to be a fallback to version 4.2.1 of IPython:
pip install "ipython<5"
(...)
Successfully uninstalled ipython-5.1.0
Successfully installed ipython-4.2.1
After that ipdb halted on a breakpoint as expected:
$ python C:\temp\ipdb_test.py
WARNING: Readline services not available or not loaded.
WARNING: Proper color support under MS Windows requires the pyreadline library.
You can find it at:
http://ipython.org/pyreadline.html
Defaulting color scheme to 'NoColor'
> c:\temp\ipdb_test.py(3)<module>()
1 import ipdb
2 ipdb.set_trace()
----> 3 print('test')
ipdb>
It may be a valid case to contact the IPython project team on the issue, meanwhile I find an initial task of running a debug session completed.

Linux libs on freebsd (ibm_db libdb2.so.1)

Im trying to use a lib on bsd that was designed for linux for IBM-db connections:
I have installed as per the ibmdocs for linux, and placed the required linux libs in /compat/linux/lib/
But i get the import error:
>>> import ibm_db
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: Shared object "libdb2.so.1" not found, required by "ibm_db.so"
If I place the file manually in /usr/lib or symlink it I get a read error:
>>> import ibm_db
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/lib/libdb2.so.1: Undefined symbol "strcspn"
If anyone could help on this I would be forever grateful!!
I have installed ibm_db and both ibm_db_sa without failure, I just think its more of an issue trying to use the linux app on bsd.
Since it's looking for libraries in /usr/lib, you seem to be running the FreeBSD version of Python.
Since FreeBSD's Linux compatibility is a per process compatibility, you cannot load Linux libraries into a FreeBSD process. If you want to dynamically load Linux libraries, you need to run a Linux version of Python.

Categories

Resources