Remote Debug under Windows

已回答

I'm trying to get a remote debugging session going under windows server 2012 using Python 3.4.0. When importing pydevd I'm getting the following traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\vs\cid8\plugins\PyPlugins\vsBNSFGeoReader\temp\pycharm-debug-py3k\pydevd.py", line 27, in <module>
    from _pydevd_bundle import pydevd_vars
  File "C:\vs\cid8\plugins\PyPlugins\vsBNSFGeoReader\temp\pycharm-debug-py3k\_pydevd_bundle\pydevd_vars.py", line 8, in
<module>
    from _pydevd_bundle.pydevd_xml import ExceptionOnEvaluate, get_type, var_to_xml
  File "C:\vs\cid8\plugins\PyPlugins\vsBNSFGeoReader\temp\pycharm-debug-py3k\_pydevd_bundle\pydevd_xml.py", line 3, in <
module>
    from _pydevd_bundle import pydevd_extension_utils
  File "C:\vs\cid8\plugins\PyPlugins\vsBNSFGeoReader\temp\pycharm-debug-py3k\_pydevd_bundle\pydevd_extension_utils.py",
line 4, in <module>
    import pydevd_plugins.extensions
  File "C:\vs\cid8\plugins\PyPlugins\vsBNSFGeoReader\temp\pycharm-debug-py3k\pydevd_plugins\__init__.py", line 2, in <mo
dule>
    __import__('pkg_resources').declare_namespace(__name__)
AttributeError: 'module' object has no attribute 'declare_namespace'

 

I'm at a loss as to what the issue is or how to resolve it. I'd appreciate any pointers.

 

Dan

0

Ended up installed pydevd via pip install. The help section detailing remote debugging should be revamped to contain troubleshooting if there are issues.

0

Hi Dan! Installing via pip is, in fact, a wrong approach, one should use a debug egg from a specific PyCharm installation as stated in the docs: https://www.jetbrains.com/help/pycharm/remote-debugging.html#python-debug-server Did you add the correct egg to the PYTHONPATH?

0

Pavel,

Did you read the traceback above? Yes I installed the correct egg, also adding it via sys.path.append().

That did not work. What worked was installing via pip. Perhaps it was because the remote debugging machine is OS X and the target machine is Windows 2012. I'm not sure.

0

Yet again I've run into this issue on another Windows instance. This time pip install didn't work, so I grabbed the eggs from my local machine and get the following traceback:

Traceback (most recent call last):
  File ".\vs_s3_checker.py", line 19, in <module>
    import pydevd
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
  File "C:\vs\cid50\plugins\PyPlugins\vsBucketChecker\pycharm-debug-py3k.egg\pydevd.py", line 27, in <module>
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
  File "C:\vs\cid50\plugins\PyPlugins\vsBucketChecker\pycharm-debug-py3k.egg\_pydevd_bundle\pydevd_vars.py", line 8, in
<module>
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
  File "C:\vs\cid50\plugins\PyPlugins\vsBucketChecker\pycharm-debug-py3k.egg\_pydevd_bundle\pydevd_xml.py", line 3, in <
module>
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
  File "C:\vs\cid50\plugins\PyPlugins\vsBucketChecker\pycharm-debug-py3k.egg\_pydevd_bundle\pydevd_extension_utils.py",
line 4, in <module>
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
  File "C:\vs\cid50\plugins\PyPlugins\vsBucketChecker\pycharm-debug-py3k.egg\pydevd_plugins\__init__.py", line 2, in <mo
dule>
AttributeError: 'module' object has no attribute 'declare_namespace'

 

 

0

请先登录再写评论。