pydev debugger not working but can run code fine - python

I am using Liclipse which is basically pydev with eclipse. The python file runs fine but when I try to use the pydev debugger on the same file the debugger fails to launch and I couldn't find anything about this error. Is it a bug in pydev? It even says "During handling of the above exception, another exception occurred"
I am using python 3.7.1
warning: Debugger speedups using cython not found. Run '"C:\Users\q4116\AppData\Local\Programs\Python\Python37-32\python.exe" "C:\Program Files\Brainwy\LiClipse 5.1.0\plugins\org.python.pydev.core_7.0.0.201811071259\pysrc\setup_cython.py" build_ext --inplace' to build.
pydev debugger: starting (pid: 20104)
Traceback (most recent call last):
File "_pydevd_bundle\pydevd_cython_win32_37_32.pyx", line 134, in _pydevd_bundle.pydevd_cython_win32_37_32.set_additional_thread_info
AttributeError: '_MainThread' object has no attribute 'additional_info'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Brainwy\LiClipse 5.1.0\plugins\org.python.pydev.core_7.0.0.201811071259\pysrc\pydevd.py", line 1951, in <module>
main()
File "C:\Program Files\Brainwy\LiClipse 5.1.0\plugins\org.python.pydev.core_7.0.0.201811071259\pysrc\pydevd.py", line 1945, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files\Brainwy\LiClipse 5.1.0\plugins\org.python.pydev.core_7.0.0.201811071259\pysrc\pydevd.py", line 1295, in run
self.notify_thread_created(thread_id, t)
File "C:\Program Files\Brainwy\LiClipse 5.1.0\plugins\org.python.pydev.core_7.0.0.201811071259\pysrc\pydevd.py", line 662, in notify_thread_created
additional_info = set_additional_thread_info(thread)
File "_pydevd_bundle\pydevd_cython_win32_37_32.pyx", line 138, in _pydevd_bundle.pydevd_cython_win32_37_32.set_additional_thread_info
File "_pydevd_bundle\pydevd_cython_win32_37_32.pyx", line 147, in _pydevd_bundle.pydevd_cython_win32_37_32.set_additional_thread_info
File "_pydevd_bundle\pydevd_cython_win32_37_32.pyx", line 95, in _pydevd_bundle.pydevd_cython_win32_37_32.PyDBAdditionalThreadInfo.__init__
AttributeError: '_pydevd_bundle.pydevd_cython_win32_37_32.PyDBAdditionalThreadInfo' object has no attribute 'pydev_state'

Sorry about that. This is a bug in PyDev 7.0.0. I just finished uploading a new version for PyDev and LiClipse is almost there too (limiting factor is my internet connection speed, so, should be available in a few hours).
Meanwhile, removing the accelerators (and recreating if you want locally) should make it work again. i.e.: Remove _pydevd_bundle*.pyd and _pydevd_bundle\pydevd_frame_eval*.pyd and execute setup_cython.py locally (or don't if you're ok on going without the accelerator modules).

I had the same issue after an update of these packages :
Oomph Setup 1.11.0.v20181107-0652 org.eclipse.oomph.setup.feature.group Eclipse Oomph Project
PyDev for Eclipse 7.0.0.201811071319 org.python.pydev.feature.feature.group Fabio Zadrozny
PyDev for Eclipse Developer Resources 7.0.0.201811071319 org.python.pydev.feature.source.feature.group Fabio Zadrozny
Not running LiClipse but just Eclipse + pydev.
I solved it for now by reverting the update. Click Help > About Eclipse IDE > Installation Details > Installation History > Click on the last working version > Revert
I should have kept the error information though so that I could file a proper bug report ...

Related

Pyinstaller fails to find kernel32 dll

Currently trying to build a exe using PyInstaller. The installation goes fine, although when trying to run the exe an exception occurs
Exception ignored in: <function Library.__del__ at 0x000002126637F160>
Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python39\lib\site-packages\pylink\library.py", line 272, in __del__
File "C:\Users\blah\AppData\Local\Programs\Python\Python39\lib\site-packages\pylink\library.py", line 390, in unload
File "C:\Users\blah\AppData\Local\Programs\Python\Python39\lib\ctypes\__init__.py", line 444, in __getattr__
File "PyInstaller\loader\pyimod04_ctypes.py", line 79, in __init__
pyimod04_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll 'kernel32'. Most likely this dynlib/dll was not found when the application was frozen.
I've followed the lead on some other posts and ensured the Visual C++ Redistributables are installed and also included --hidden-import ctypes in the build to no avail.
Building on Windows 10 - Python 3.9 - PyInstaller 5.0.1
Any help would be great!
Taken from the comments on the original answer. Quote stevod:
I ended up finding the problem, our company anti virus wouldn't let the bootloader access the required files, so we had to rebuild the bootloader manually and then it worked!
The same worked also for me.

Python 3.3.5 Console does not start in PyCharm 2016.3.1

Please, could you help? I am unable to get the python console started in PyCharm. Have played with all option available and have trawled through the documentation, but cannot figure this one out. Any help would be appreciated. Please find below the error I get in the console...
OS: Win 10
C:\Miniconda3\python.exe "C:\Program Files (x86)\JetBrains\PyCharm\helpers\pydev\pydevconsole.py" 64331 64332
Traceback (most recent call last):
File "C:\Miniconda3\lib\site-packages\traitlets\traitlets.py", line 526, in get
value = obj._trait_values[self.name]
KeyError: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm\helpers\pydev\pydevconsole.py", line 526, in <module>
pydevconsole.start_server(pydev_localhost.get_localhost(), int(port), int(client_port))
File "C:\Program Files (x86)\JetBrains\PyCharm\helpers\pydev\pydevconsole.py", line 355, in start_server
interpreter = InterpreterInterface(host, client_port, threading.currentThread())
File "C:\Program Files (x86)\JetBrains\PyCharm\helpers\pydev\_pydev_bundle\pydev_ipython_console.py", line 25, in __init__
self.interpreter = get_pydev_frontend(host, client_port, show_banner=show_banner)
File "C:\Program Files (x86)\JetBrains\PyCharm\helpers\pydev\_pydev_bundle\pydev_ipython_console_011.py", line 488, in get_pydev_frontend
_PyDevFrontEndContainer._instance = _PyDevFrontEnd(show_banner=show_banner)
File "C:\Program Files (x86)\JetBrains\PyCharm\helpers\pydev\_pydev_bundle\pydev_ipython_console_011.py", line 318, in __init__
self.ipython = PyDevTerminalInteractiveShell.instance()
File "C:\Miniconda3\lib\site-packages\IPython\config\configurable.py", line 337, in instance
inst = cls(*args, **kwargs)
File "C:\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 512, in __init__
self.init_readline()
File "C:\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 1911, in init_readline
if self.readline_use:
File "C:\Miniconda3\lib\site-packages\traitlets\traitlets.py", line 554, in __get__
return self.get(obj, cls)
File "C:\Miniconda3\lib\site-packages\traitlets\traitlets.py", line 532, in get
% (self.name, obj))
traitlets.traitlets.TraitError: No default value found for None trait of <_pydev_bundle.pydev_ipython_console_011.PyDevTerminalInteractiveShell object at 0x00000000042CFBA8>
Process finished with exit code 1
Ok, after much twiddling about:
Changing the interpreter to a different version (to Python 3.5.x) made this work. This made me wonder if IPython was the issue.. and it sure was!!
The problem is that the IPython for Python 3.3.5 does not work with PyCharm. IPython Version 5 was installed by PyCharm, but does not work with Python 3.3.5.
I removed IPython using 'Conda uninstall' and then 'Conda clean' and restarted the console, it then worked like a charm...
In essence:
1. Exit Pycharm
2. Remove IPython - use 'Conda remove/uninstall' and then 'conda clean' to completely get rid of it.
3. Restart Pycharm and allow it reimport all 'skeletons'
4. Restart Console.
I had a similar problem on Fedora 24. For some reason Fedora still ships IPython 3.x :/ I simply upgraded it with pip3 install ipython --upgrade which installed IPython 6.0.0 and it works :D

Cannot start a console in newly installed Pycharm in Windows

On Windows 7 machine, Pycharm (community or professional) and Python 3.4 (tried Anaconda 3 as well) were installed newly. There were not problems running Python scripts interactively in main editor. However, when I tried to select View > Tool Windows > Python Console, it generates the following error messages and more. Basically, I couldn't bring up a console window in Pycharm.
C:\Users\user\Anaconda3\python.exe -u C:\Program Files (x86)\JetBrains\PyCharm 4.0.5\helpers\pydev\pydevconsole.py 56743 56744
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm 4.0.5\helpers\pydev\pydev_imports.py", line 21, in <module>
from SimpleXMLRPCServer import SimpleXMLRPCServer
ImportError: No module named 'SimpleXMLRPCServer'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm 4.0.5\helpers\pydev\pydevconsole.py", line 20, in <module>
import pydevd_vars
File "C:\Program Files (x86)\JetBrains\PyCharm 4.0.5\helpers\pydev\pydevd_vars.py", line 9, in <module>
from pydevd_xml import *
File "C:\Program Files (x86)\JetBrains\PyCharm 4.0.5\helpers\pydev\pydevd_xml.py", line 7, in <module>
from pydev_imports import quote
File "C:\Program Files (x86)\JetBrains\PyCharm 4.0.5\helpers\pydev\pydev_imports.py", line 23, in <module>
from xmlrpc.server import SimpleXMLRPCServer
File "C:\Users\user\Anaconda3\lib\xmlrpc\server.py", line 108, in <module>
from http.server import BaseHTTPRequestHandler
File "C:\Users\user\Anaconda3\lib\http\server.py", line 660, in <module>
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
File "C:\Users\user\Anaconda3\lib\http\server.py", line 851, in SimpleHTTPRequestHandler
mimetypes.init() # try to read system mime.types
File "C:\Users\user\Anaconda3\lib\mimetypes.py", line 348, in init
db.read_windows_registry()
File "C:\Users\user\Anaconda3\lib\mimetypes.py", line 255, in read_windows_registry
with _winreg.OpenKey(hkcr, subkeyname) as subkey:
TypeError: OpenKey() argument 2 must be str without null characters or None, not str
Process finished with exit code 1
Couldn't connect to console process.
-----------------these messages were showed up in "Python Console"-------------
You need to change your working directory. Go to File->Settings->Build, Execution, Deployment->Console->Python Console and then change or provide a directory where you have read and write access in the Working directory box.
The configuring of pycharm in the presence of various development configurations is a bit of a black art IMHO.
The most effective mechanism I've found for pinning this down is put random strings into the various settings dialogs, Interpreters, consoles, tests , servers and observe the command lines submitted to the interpreter VERY carefully.
Hardly a satisfactory approach but it will sort out what is going where and to a certain degree what effects what.
The other think that helps me are screenshots of the settings and testing dialogs of working installations.
Again, a bit rough and ready but it has got me up and running again after a long period of successful debugging followed by pycharm amnesia.
I had same problem. I reinstalled python and default directories have changed.
Then I just refreshed interpreter here File->Settings->Build, Execution, Deployment->Console->Python Console and here File->Settings->Project: <YOUR_PROJECT>->Project Interpreter.
If you will open new projects interpreter will need choose again (?)
I got it resolved by setting the interpreter in Preferences and project interpreter.

Debugging twisted application using PyCharm

I am fighting a few hours trying to configure PyCharm for debugging my app. I was looking for solution, but twisted seems to not be so popular and there is weak support. Below I put error log that i got.
/usr/local/bin/python3.4m -u /Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_run_in_console.py 57276 57277 /usr/bin/twistd -y /Users/artur/projs/private/elanga-web/start_app.tac
Running /usr/bin/twistd
PyDev console: starting.
Traceback (most recent call last):
File "/usr/bin/twistd", line 7, in <module>
import _preamble
ImportError: No module named '_preamble'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_run_in_console.py", line 68, in <module>
globals = run_file(file, None, None)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_run_in_console.py", line 28, in run_file
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/usr/bin/twistd", line 9, in <module>
sys.exc_clear()
AttributeError: 'module' object has no attribute 'exc_clear'
Process finished with exit code 1
Couldn't connect to console process.
I will be grateful for an answer why there is no such module like _preamble
On OS X, /usr/bin/twistd is a version of Twisted installed into the system python. This is not python 3.4. The symptom you're seeing is not the missing _preamble module (which is in fact not supposed to be installed, which is why there is an except block around that import catching the exception) but rather that you have pointed python 3.4 at some random python 2 program.
If you want to run python 3.4, you need to create a python 3 environment with Twisted installed. Keep in mind that not all of Twisted is ported, so only a subset of APIs will be available to you. One of the things that is not ported to python 3 yet is the twistd command line, so there's no way to run twistd with python 3 yet.

GAE SDK and Launcher fails to run

I've just installed GAE SDK on a new computer and it failed to start.
When I open GAE Launcher it warns about errors, and log file has this.
WARNING:root: Warning: Prerequisites for App Engine development are
missing!
A valid python binary must be available. In addition, the App
Engine SDK must be installed. Here are the current values we found:
python = None
App Engine SDK root = C:\Program Files (x86)\Google\google_appengine
Please install the missing pieces and restart the launcher. If
these are installed but the Launcher failed to find them, you can
configure their location by editing Launcher preferences.
The Launcher preferences can be modified by selecting Edit >
Preferences.
Traceback (most recent call last):
A long list of traces there.
I've re-installed both Python and GAE SDK. Checked the PATH variables.
It's: C:\python27\;C:\Program Files (x86)\Google\google_appengine\
But it doesn't work!
How could I fix this?
I would appreciate any help on this.
Upd. I tried removing C:/users/username/Google/google_appengine_projects.ini this file.
The project is addede to the Launcher but it freezes the time I'm starting it. (server doesn't start)
Logs are:
2013-11-29 10:05:14 Running command:
"['C:\Python27\python.exe', 'C:\Program Files
(x86)\Google\google_appengine\dev_appserver.py',
'--skip_sdk_update_check=yes', '--port=8080', '--admin_port=8000',
u'C:\Users\\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\\u0414\u0438\u0441\u043a
Google\Work\E\Adriatika\\app-engine\adriatika]"
>
> Traceback (most recent call last): File
> "GoogleAppEngineLauncher.py", line 42, in <module> File
> "wx\_core.pyc", line 7913, in __init__ File "wx\_core.pyc", line
> 7487, in _BootstrapApp File "launcher\app.pyc", line 53, in OnInit
> File "launcher\app.pyc", line 97, in _CreateModels File
> "launcher\maintable.pyc", line 35, in __init__ File
> "launcher\maintable.pyc", line 96, in _LoadProjects File
> "launcher\project.pyc", line 63, in ProjectWithConfigParser File
> "launcher\project.pyc", line 285, in _LoadFromConfigParser File
> "ConfigParser.pyc", line 520, in get ConfigParser.NoOptionError: No
> option 'name' in section: '0'
I found a temporary fix.
First of all I removed everything and installed Python from scratch.
I also installed a previous version of GAE SDK (1.8.7)
Then I moved my working folder. Cause it had cyrillic utf symbols in its title. And I guess GAE Parser didnt like those symbols.
After all that I could finally launch GAELauncher.

Categories