0

How do you get started running (and debugging) a C++/Python combined project?

So far I've started with the basics:

  1. Checking out the project from source (http://code.google.com/p/pyv8/source/checkout)
  2. Copying a helloworld.py example into the directory with PyV8, so it can import PyV8.

This doesn't work, of course:

Traceback (most recent call last):
  File "helloworld.py", line 4, in <module>
    import PyV8
  File "C:\Users\Default User\Documents\pyv8-read-only\PyV8.py", line 32, in
<module>
    import _PyV8
ImportError: No module named _PyV8

The next step is probably to compile the cpp files and somehow make them available to Python as a library, but I'm not sure how to do that from the command line. There appears to be a VS project but I don't have Visual Studio.

(It would be way more awesome if anyone could also figure out how to debug both the C++ and Python parts in Eclipse)

Help! Thanks.

Chris
  • 5,876
  • 3
  • 43
  • 69
  • You're going to need a C++ compiler and some other stuff. See [HowToBuild - pyv8 - How to build the module from source](http://code.google.com/p/pyv8/wiki/HowToBuild) for instructions. Looks like gcc or VS 10 would work. – martineau Feb 14 '13 at 16:56
  • gcc would be a little awkward on Windows (might need to Cygwin/MinGW it). Is there a version of VS10 I can use without buying the IDE? – Chris Feb 14 '13 at 17:08
  • [Yes](http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express). – martineau Feb 14 '13 at 17:18
  • The only question being whether Express will do what I need it do. Thanks! – Chris Feb 14 '13 at 18:25
  • 1
    You may encounter problems debugging because the Python interpreter is built with VS2008 and is a non-debug build, which I understand can cause runtime library [conflicts](http://bugs.python.org/issue13210) if the extension is built differently. – martineau Feb 14 '13 at 19:10

0 Answers0