thp / pyotherside

Python Bindings for Qt 5 and Qt 6. Allows you to access a CPython 3 interpreter directly from your Qt QML user interface code.
https://thp.io/2011/pyotherside/
Other
364 stars 49 forks source link

Can not compile #37

Closed helambuapps closed 9 years ago

helambuapps commented 9 years ago

Im under virtualenv and I got this error Python.h: No such file or directory

I tried installing sudo apt-get install python-dev and sudo apt-get install python3-dev but still no luck.

I sort of managed to get away with this problem manually copying all the header files into the src directory but now it says undefined reference toPyGILState_Ensure` and heaps of undefined reference errors.

Still can not compile.

thp commented 9 years ago

Try without virtualenv. What is the error message you get? You have to use Python 3, Python 2 is not supported. Copying header files is not enough, as you also have to link against the libpython library.

helambuapps commented 9 years ago

The errors are undefined reference to PyGIL* heaps of them because the library files are not found since I just copied the header files.

I managed to compile it down to the object files and pass all the tests without pyenv. I prefer not to install it globally because I really love the philosophy of sandboxing each project into its own virtual python environment but not sure how to actually copy and use the compiled files under the pyenv.

I quickly went through the documentation, but can't manage get my head around how to do all the housekeeping stuffs before actually getting started.

Do you have a quick hello world tutorial for beginners?

thp commented 9 years ago

You have to build PyOtherSide outside of a virtualenv. Only for running you might be able to use a virtualenv if you have dependent packages that you'd like to use.

Judging from your apt-get lines, it looks like you are on Debian or Ubuntu, you can just download PyOtherSide via apt-get:

apt-get install pyotherside

Debian package: https://packages.debian.org/jessie/pyotherside Ubuntu package: http://packages.ubuntu.com/vivid/pyotherside