Problem with building Boost Graph Library Python bindings under Leopard - python

I've inherited some Python code which is importing boost.graph and I'm having an issue setting up the following under Mac OS X Leopard (I believe this is what I need to install to get it working):
http://osl.iu.edu/~dgregor/bgl-python/
According to the readme I need to build with bjam, but I see the following error:
[matt#imac ~/Downloads/bgl-python-0.9]$ bjam
error: Could not find parent for project at '.'
error: Did not find Jamfile or project-root.jam in any parent directory.
I'm running a full Macports stack of python25, boost, boost-jam, boost-build.
I don't have any experience with building using bjam. Can anyone offer any help?

This error suggests the project is not a standalone, and is meant to be put inside the Boost source tree.

Related

Is there a version compatibility issue between Spark/Hadoop/Scala/Java/Python?

I'm getting an error while running spark-shell command through cmd but unfortunately without any luck so far. I have Python/Java/Spark/Hadoop(winutils.exe)/Scala installed with versions as below:
Python: 3.7.3
Java: 1.8.0_311
Spark: 3.2.0
Hadoop(winutils.exe):2.5x
scala sbt: sbt-1.5.5.msi
I followed below steps and ran spark-shell (C:\Program Files\spark-3.2.0-bin-hadoop3.2\bin>) through cmd:
Create JAVA_HOME variable: C:\Program Files\Java\jdk1.8.0_311\bin
Add the following part to your path: %JAVA_HOME%\bin
Create SPARK_HOME variable: C:\spark-3.2.0-bin-hadoop3.2\bin
Add the following part to your path: %SPARK_HOME%\bin
The most important part Hadoop path should include bin file before winutils.exe as the following: C:\Hadoop\bin Sure you will locate winutils.exe inside this path.
Create HADOOP_HOME Variable: C:\Hadoop
Add the following part to your path: %HADOOP_HOME%\bin
Am I missing out on anything? I've posted my question with error details in another thread (spark-shell command throwing this error: SparkContext: Error initializing SparkContext)
You went the difficult way in installing everything by hand. You may need Scala too, be extremely vigilant with the version you are installing, from your example it seems like it’s Scala 2.12.
But you are right: Spark is extremely demanding in term of version matching. Java 8 is good. Java 11 is ok too, but not any more recent version.
Alternatively, you can:
Try a very simple app like in https://github.com/jgperrin/net.jgp.books.spark.ch01
Use Docker with a pre made image, and if your goal is to do Python, I would recommend an image with Jupiter and Spark preconfigured together.

Python gives error when importing simple C extension module

On windows I have built a very simple "hello world" C extension (the file hello.c from this site https://gist.github.com/physacco/2e1b52415f3a964ad2a542a99bebed8f). Using VS2015 I successfully obtain hello.dll. The problem is that I can't figure out how to import this file/module.
In the python shell (python 3.7) I have made sure that I'm in the same folder as the hello.dll. I have also made sure that sys.path() contains the folder path. But when I write "import hello" I get an error "ModuleNotFoundError: No module named 'hello'"
Does anyone has an idea of what is wrong is this very simple setup?
Update:
When trying to import a module that does not exist the ModuleNotFoundError is reported. After renaming the hello.dll to hello.pyd an ImportError is returned. So it seems like it tries to actually load the module.
Python compiled modules on Windows have the extension .pyd, not .dll. If you'd built it using setup.py the file would be built with the correct name. However, you built it yourself and gave it a name that Python doesn't recognise as a module.
In terms of the build command: you have to link it with libpython. You don't look to be doing this. The error you report is definitely one that you can get if the module is not linked against all its dependencies.
I know you don't want to use setup.py, however I'd use it at least once just to see what it does and if it works. You'll then at least have a command that you can copy with a working set of options.

undefined symbol: _ZN2cv3Mat10deallocateEv

I've been trying to extend my python script with a C++ code. I was able to do that with the simple libraries of C++ (print "hello world"). I followed the tutorial available in the link below:
http://www.tutorialspoint.com/python/python_further_extensions.htm
When I tried to add to my C++ code opencv libraries I encountered the following problem:
ImportError: /usr/local/lib/python2.7/dist-packages/kalman.so: undefined symbol: _ZN2cv3Mat10deallocateEv
I searched for many solutions on the internet, and I found one common answer that didn't workout for me:
"I was able to solve this by going to /usr/lib64/pkgconfig and modified opencv.pc to explicitly have all libraries. I also had to move the plugins from /usr/lib/gstreamer-0.10 to /usr/lib64/gstreamer-0.10"
Please note that I am using ubuntu 14.04 LTS 64-bit and I am planning to run my code later on on a raspberry pi model B running Raspbian OS.
Thank you.
NJ
Check your shared library kalman.so with ldd like so:
$ ldd kalman.so
And you will see that you are missing some libraries. That means that you have to provide some correct path to one of the libraries you use in your code at the linkage stage. something like
$ ...the way you do linking ... -L path_to_the_missing_library
For more information, please, consult this link.
I've met the same problem as you do, and at last I figured out that this is because I didn't add the linking library of opencv when compiling. Try to add the "opencv_core" or other related library when you compile the c++ source file.
Wish this to be helpful to you.

error on importing pyIpopt

I'm trying to install and configure pyIpopt. Ipopt is already installed and the examples run fine.
From the shell, when I do import pyIpopt, I get the error:
ImportError: /***PATH***/libipopt.so.1: undefined symbol: MPI_Init
The FAQ section of the pyIpopt git project has this to offer for these kinds of errors:
Do a Google search to find the library file, and add
-lWhateverLibrary in the makefile of pyipopt.
I've googled and found this: http://www.mcs.anl.gov/research/projects/mpi/www/www3/MPI_Init.html.
I don't know how to get the library or add it to the makefile... Any assistance would be much appreciated!
Just had a similar problem on ubuntu.
Using libmumps-seq worked for me:
installed libmumps-seq-4.9.2 (just with apt-get, along side the ordinary libmumps)
in setup.py changed in the libraries list argument 'coinmumps' to 'dmumps_seq-4.9.2'
rebuilt and installed.
If I understand it correctly, the default mumps is distributed (using MPI lib which can be a world of pain), and all i needed is the sequential one, which mumps-seq provides.

From where can I get python27.dll and wxmsw dll

Our current project is made up of Python2.3 and wxPython-2.4.1.2. It is working fine. But now we are upgrading it to Python2.7 and wxPython2.8.12.1.
As I am new to Python and installation dlls, I need little guidence.
There are following files present in my NSIS installation folder for old Python:
python23.dll
wxmsw24h.dll
As this project was made by previous programmer, I don't know from where he got these dlls or how he made this dll.
I think, to make the installation program for my new python, I will need the following dlls:
python27.dll
wxmsw28h.dll
As per I understand, for wxmsw dll, I need to compile wxPython-src but not sure what can I do for this?
Please let me know, from where can I get these dlls? If I need to create it then please let me know, how can I create these dlls?
Thanks in advance.
Python DLL:
c:\WINDOWS\system32\python27.dll
or:
C:\Windows\SysWOW64\python27.dll
wxPython DLLs:
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxbase28uh_net_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxbase28uh_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxbase28uh_xml_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxmsw28uh_adv_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxmsw28uh_aui_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxmsw28uh_core_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxmsw28uh_gizmos_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxmsw28uh_gizmos_xrc_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxmsw28uh_gl_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxmsw28uh_html_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxmsw28uh_media_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxmsw28uh_qa_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxmsw28uh_richtext_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxmsw28uh_stc_vc.dll
c:\Python27\Lib\site-packages\wx-2.8-msw-unicode\wx\wxmsw28uh_xrc_vc.dll
But if you install Python and wxPython using installer, you should not need to copy it anywhere if you are not building binary. If you are building standalone binary, see Blender's comment.

Categories