Eclipse + pydev debug openstack and pydevopenstack

Source: Internet
Author: User

Eclipse + pydev debug openstack and pydevopenstack

 

1. Install eclipse to debug openstack.

2. Install the pydev plug-in on eclipse:

Window-> preferences-> general-> networkconnect

Activeprovider: manual

Editproxy entry: schema: http, host: 127.0.0.1, port: 8123,

Help-> installnew software-> work with: pydev-http://pydev.org/updates

Select the pydev version corresponding to the python version in the system.

Cancel "show only the latestversions of available software"

Next-> finish

3. (copy the openstack source code built in the virtual machine to "my_openstack" in the local eclipse workspace project ")

File-> new-> pydevproject-> project name: my_openstack

Cancel "use default"

Select the directory "/root/workspace/my_openstack"

Grammarversion: corresponding to the python version

Iterpreter: python

"Addproject directory to the PYTHONPATH"

Finish

4. Copy the eclipse \ plugins \ org. python. pydev_x.x.x \ pysrc directory to the Virtual Machine "/home/pysrc"

5. Modify pydev_file_utils.py in pysrc of the VM:

PATHS_FROM_ECLIPSE_TO_PYTHON = [(R'/root/soft/eclipse_jck/plugins/org. python. pydev_2.6.0.2012062818/pysrc/', R'/home/panfy/pysrc/'), (R'/root/workspace/pydev_openstack /', r'/usr/lib/python2.7/site-packages/')]

DEBUG_CLIENT_SERVER_TRANSLATION = True

6. Modify the openstack code of the VM:

For example, you need to debug ceilometerclient.

Modify shell. py in ceilometerclient

Importsys

Sys. path. append ('/home/pysrc ')

Add import pydevd; pydevd. settrace ('10. 167.225.103 ') to the IP address of the local host.

To the beginning of the debugging

7. In eclipse:

* Debug-> start the debugging service: pydev: start the pydevserver

Prompt "debug server at port: 5678" appears

8. Execute the corresponding commands in the virtual machine to trigger debugging.

 


An error occurred while debugging python in eclipse. Unexpected IO Exception in Pydev debugger

Refer:
[Solved] unable to debug Python: Unexpected IO Exception in PyDev debugger in Eclipse + Pydev

(No post address is provided here. Please search for the title on Google to find the post address)
 
The IDE built by pydev + eclipse cannot enter the single-step debugging status debug as --> python run does not stay at the breakpoint, nor jump into debug

It's so professional that I have never played it.
Also, I am very surprised, does python code need to be debugged in one step? Is it enough to complete the log?
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.