Hi Ivan - sorry to hear you're having some issues - let's see if I can help.
First off - let me suggest you try using the 0.10 release of proton instead of 0.9.1. Not only has there been a number of bugfixes and improvements over the old 0.9 release, but the python setup.py scripts have changed quite a bit. At this point I haven't released an "offical" version of the python-qpid-proton 0.10 bindings up a pypi - there's been some API changes that some downstream projects need to adapt to first before I make 0.10 available. But I do have a test release of 0.10 available up at testpypi - you can get it using pip: pip install -i https://testpypi.python.org/pypi python-qpid-proton See inline below for more suggestions/questions: ----- Original Message ----- > From: "Ivan Judson" <[email protected]> > To: [email protected] > Sent: Friday, August 28, 2015 12:41:37 PM > Subject: Trying to use python-qpid-proton > > Hi, > > I’m trying to use the python bindings to quid-proton to write a python AMQP > script. I have tried using it on Windows 10 (and 8.1), Ubuntu 14.04LTS, and > Mac OS X 10.10.5. Here are the problems I’m running into on each platform: > > Mac OS X: > > Brook:python-eh irjudson$ pip install python-qpid-proton > Collecting python-qpid-proton > Using cached python-qpid-proton-0.9.1.1.zip > Installing collected packages: python-qpid-proton > Running setup.py install for python-qpid-proton > Complete output from command /usr/local/opt/python/bin/python2.7 -c > "import setuptools, > > tokenize;__file__='/private/var/folders/hg/8w56nx7x0m53051d3dlxh85c0000gn/T/pip-build-HRYEgV/python-qpid-proton/setup.py';exec(compile(getattr(tokenize, > 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, > 'exec'))" install --record > > /var/folders/hg/8w56nx7x0m53051d3dlxh85c0000gn/T/pip-mDTz5f-record/install-record.txt > --single-version-externally-managed --compile: > running install > running build > running build_ext > running configure > building '_cproton' extension > swigging cproton.i to cproton_wrap.c > swig -python -threads -o cproton_wrap.c cproton.i > cproton.i:310: Error: Unable to find 'proton/cproton.i' > error: command 'swig' failed with exit status 1 > > ---------------------------------------- > Command "/usr/local/opt/python/bin/python2.7 -c "import setuptools, > tokenize;__file__='/private/var/folders/hg/8w56nx7x0m53051d3dlxh85c0000gn/T/pip-build-HRYEgV/python-qpid-proton/setup.py';exec(compile(getattr(tokenize, > 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" > install --record > /var/folders/hg/8w56nx7x0m53051d3dlxh85c0000gn/T/pip-mDTz5f-record/install-record.txt > --single-version-externally-managed --compile" failed with error code 1 in > /private/var/folders/hg/8w56nx7x0m53051d3dlxh85c0000gn/T/pip-build-HRYEgV/python-qpid-proton > To be honest - I don't have access to a Mac so I'll have to take a guess here: I've seen that error before when an older version of pip is used to install. Try to "pip install --upgrade pip" or "pip install --user pip". If you can't upgrade, or upgrading doesn't solve the problem, you can try patching the setup.py file directly. You would need to specify the proper swig options to the extension, as done below: ext_modules=[Extension('_cproton', ['cproton.i'], libraries=['qpid-proton'], swig_opts=["-threads", "-I<path to the proton include files>")]) Note: totally untested, I may have gotten the syntax wrong. The <path> argument has the be a full path to the directory that contains the proton header directory - like "/usr/include" or something like that. > Ubuntu 14.04LTS: > > (dev)parallels@ubuntu:~/python-eh$ pip install python-qpid-proton > Collecting python-qpid-proton > /home/parallels/python-eh/dev/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: > InsecurePlatformWarning: A true SSLContext object is not available. This > prevents urllib3 from configuring SSL appropriately and may cause certain > SSL connections to fail. For more information, see > https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. > InsecurePlatformWarning > Using cached python-qpid-proton-0.9.1.1.zip > Building wheels for collected packages: python-qpid-proton > Running setup.py bdist_wheel for python-qpid-proton > Complete output from command /home/parallels/python-eh/dev/bin/python -c > "import > > setuptools;__file__='/tmp/pip-build-tY21QC/python-qpid-proton/setup.py';exec(compile(open(__file__).read().replace('\r\n', > '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpfuORP3pip-wheel-: > running bdist_wheel > running build > running build_ext > running configure > Using libqpid-proton (found via pkg-config). > Using libqpid-proton (found via pkg-config). > building '_cproton' extension > swigging cproton.i to cproton_wrap.c > swig -python -threads -I/usr/include -I/usr/local/include -o cproton_wrap.c > cproton.i > creating build > creating build/temp.linux-x86_64-2.7 > x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 > -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cproton_wrap.c > -o build/temp.linux-x86_64-2.7/cproton_wrap.o > cproton_wrap.c: In function ‘wrap_pn_delivery’: > cproton_wrap.c:3329:5: error: too few arguments to function ‘pn_dtag’ > return pn_delivery(link, pn_dtag(STRING, LENGTH)); > ^ > In file included from /usr/include/proton/engine.h:38:0, > from cproton_wrap.c:3023: > /usr/include/proton/delivery.h:65:33: note: declared here > static inline pn_delivery_tag_t pn_dtag(const char *bytes, size_t size, > uint32_t format) { > ^ > cproton_wrap.c: In function ‘_wrap_pn_messenger’: > cproton_wrap.c:16044:35: warning: the comparison will always evaluate as > ‘true’ for the address of ‘pn_message’ will never be NULL [-Waddress] > SWIG_contract_assert((pn_message!=NULL), "Contract violation: ensure: > (pn_message!=NULL)"); > ^ > cproton_wrap.c:2908:47: note: in definition of macro ‘SWIG_contract_assert’ > #define SWIG_contract_assert(expr, msg) if (!(expr)) { > SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else > ^ > cproton_wrap.c: At top level: > cproton_wrap.c:7786:12: warning: ‘check_state’ defined but not used > [-Wunused-function] > static int check_state(int x) { > ^ > cproton_wrap.c:7797:12: warning: ‘check_disposition’ defined but not used > [-Wunused-function] > static int check_disposition(int x) { > ^ > cproton_wrap.c:7808:12: warning: ‘check_trace’ defined but not used > [-Wunused-function] > static int check_trace(int x) { > ^ > cproton_wrap.c: In function ‘wrap_pn_delivery’: > cproton_wrap.c:3330:3: warning: control reaches end of non-void function > [-Wreturn-type] > } > ^ > error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 > > ---------------------------------------- > Failed building wheel for python-qpid-proton > Failed to build python-qpid-proton > Installing collected packages: python-qpid-proton > Running setup.py install for python-qpid-proton > Complete output from command /home/parallels/python-eh/dev/bin/python -c > "import setuptools, > > tokenize;__file__='/tmp/pip-build-tY21QC/python-qpid-proton/setup.py';exec(compile(getattr(tokenize, > 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, > 'exec'))" install --record /tmp/pip-ZAMLQT-record/install-record.txt > --single-version-externally-managed --compile --install-headers > /home/parallels/python-eh/dev/include/site/python2.7/python-qpid-proton: > running install > running build > running build_ext > running configure > Using libqpid-proton (found via pkg-config). > Using libqpid-proton (found via pkg-config). > building '_cproton' extension > swigging cproton.i to cproton_wrap.c > swig -python -threads -I/usr/include -I/usr/local/include -o > cproton_wrap.c cproton.i > x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv > -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c > cproton_wrap.c -o build/temp.linux-x86_64-2.7/cproton_wrap.o > cproton_wrap.c: In function ‘wrap_pn_delivery’: > cproton_wrap.c:3329:5: error: too few arguments to function ‘pn_dtag’ > return pn_delivery(link, pn_dtag(STRING, LENGTH)); > ^ > In file included from /usr/include/proton/engine.h:38:0, > from cproton_wrap.c:3023: > /usr/include/proton/delivery.h:65:33: note: declared here > static inline pn_delivery_tag_t pn_dtag(const char *bytes, size_t size, > uint32_t format) { > ^ > cproton_wrap.c: In function ‘_wrap_pn_messenger’: > cproton_wrap.c:16044:35: warning: the comparison will always evaluate as > ‘true’ for the address of ‘pn_message’ will never be NULL [-Waddress] > SWIG_contract_assert((pn_message!=NULL), "Contract violation: ensure: > (pn_message!=NULL)"); > ^ > cproton_wrap.c:2908:47: note: in definition of macro > ‘SWIG_contract_assert’ > #define SWIG_contract_assert(expr, msg) if (!(expr)) { > SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else > ^ > cproton_wrap.c: At top level: > cproton_wrap.c:7786:12: warning: ‘check_state’ defined but not used > [-Wunused-function] > static int check_state(int x) { > ^ > cproton_wrap.c:7797:12: warning: ‘check_disposition’ defined but not used > [-Wunused-function] > static int check_disposition(int x) { > ^ > cproton_wrap.c:7808:12: warning: ‘check_trace’ defined but not used > [-Wunused-function] > static int check_trace(int x) { > ^ > cproton_wrap.c: In function ‘wrap_pn_delivery’: > cproton_wrap.c:3330:3: warning: control reaches end of non-void function > [-Wreturn-type] > } > ^ > error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 > > ---------------------------------------- > Command "/home/parallels/python-eh/dev/bin/python -c "import setuptools, > tokenize;__file__='/tmp/pip-build-tY21QC/python-qpid-proton/setup.py';exec(compile(getattr(tokenize, > 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" > install --record /tmp/pip-ZAMLQT-record/install-record.txt > --single-version-externally-managed --compile --install-headers > /home/parallels/python-eh/dev/include/site/python2.7/python-qpid-proton" > failed with error code 1 in /tmp/pip-build-tY21QC/python-qpid-proton > /home/parallels/python-eh/dev/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: > InsecurePlatformWarning: A true SSLContext object is not available. This > prevents urllib3 from configuring SSL appropriately and may cause certain > SSL connections to fail. For more information, see > https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. > InsecurePlatformWarning > > Interesting - I suspect the python install is using the wrong version of proton in this case. Be sure that the 0.9.1 proton headers are in /usr/include or /usr/local/include. Be sure you've removed any trace of older versions of proton headers or libraries from the system. > And finally, windows 10, visual studio 2015: > > > Installing 'python-qpid-proton' > > Downloading/unpacking python-qpid-proton > > Running setup.py (path:c:\users\ivanjud\documents\visual studio > > 2015\Projects\AzureCloudService1\WorkerRole1\env\build\python-qpid-proton\setup.py) > egg_info for package python-qpid-proton > > > > file cproton.py (for module cproton) not found > > Installing collected packages: python-qpid-proton > > Running setup.py install for python-qpid-proton > > building '_cproton' extension > > swigging cproton.i to cproton_wrap.c > > C:\ProgramData\chocolatey\bin\swig.exe -python -threads -o cproton_wrap.c > cproton.i > > cproton.i(310) : Error: Unable to find 'proton\cproton.i' > > error: command 'C:\\ProgramData\\chocolatey\\bin\\swig.exe' failed with > exit status 1 > > Complete output from command "c:\users\ivanjud\documents\visual studio > 2015\Projects\AzureCloudService1\WorkerRole1\env\Scripts\python.exe" -c > "import setuptools, > tokenize;__file__='c:\\users\\ivanjud\\documents\\visual studio > > 2015\\Projects\\AzureCloudService1\\WorkerRole1\\env\\build\\python-qpid-proton\\setup.py';exec(compile(getattr(tokenize, > 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, > 'exec'))" install --record > c:\users\ivanjud\appdata\local\temp\pip-xzjsaa-record\install-record.txt > --single-version-externally-managed --compile --install-headers > "c:\users\ivanjud\documents\visual studio > 2015\Projects\AzureCloudService1\WorkerRole1\env\include\site\python2.7": > > running install > > running build > > running build_ext > > running configure > > building '_cproton' extension > > swigging cproton.i to cproton_wrap.c > > C:\ProgramData\chocolatey\bin\swig.exe -python -threads -o cproton_wrap.c > cproton.i > > cproton.i(310) : Error: Unable to find 'proton\cproton.i' > > error: command 'C:\\ProgramData\\chocolatey\\bin\\swig.exe' failed with exit > status 1 > > ---------------------------------------- > > Cleaning up... > > Command "c:\users\ivanjud\documents\visual studio > 2015\Projects\AzureCloudService1\WorkerRole1\env\Scripts\python.exe" -c > "import setuptools, tokenize;__file__='c:\\users\\ivanjud\\documents\\visual > studio > 2015\\Projects\\AzureCloudService1\\WorkerRole1\\env\\build\\python-qpid-proton\\setup.py';exec(compile(getattr(tokenize, > 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" > install --record > c:\users\ivanjud\appdata\local\temp\pip-xzjsaa-record\install-record.txt > --single-version-externally-managed --compile --install-headers > "c:\users\ivanjud\documents\visual studio > 2015\Projects\AzureCloudService1\WorkerRole1\env\include\site\python2.7" > failed with error code 1 in c:\users\ivanjud\documents\visual studio > 2015\Projects\AzureCloudService1\WorkerRole1\env\build\python-qpid-proton > > Storing debug log for failure in C:\Users\ivanjud\pip\pip.log > > 'python-qpid-proton' failed to install. Exit code: 1 > Looks similar to the "old pip" issue. Are you installing using pip from the command line, or are you using VS? > > > Any help would be appreciated — my end goal is to use this on windows, so > that’s preferred, but I’m willing to work on which ever platform is easiest > (first). > A linux based derivative like Ubuntu/Fedora definitely sees the most testing, but we need to get this working for Windows also. I'd first try to use the 0.10 release of python-qpid-proton and we can debug from there. > -Ivan > > Ivan R. Judson, PhD > Microsoft > +1 (425) 679-1375 | > [email protected]<mailto:[email protected]> | > http://irjudson.org/ > > -- -K --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
