[mlpack] issue with mlpack Python bindings on Mac OsX

Ryan Curtin ryan at ratml.org
Tue Dec 18 23:09:33 EST 2018


On Sat, Dec 15, 2018 at 03:13:58PM +0000, Frodo Jedi wrote:
> Hi Ryan,
> running make python with sudo gives no errors.
> 
> Surely I was building as the same user that I configured the project with.
> I could not understand what you were referring to with crsutils and
> especially what links on overflow you were referring to. I am not sure what
> should I search for.

No worries, I guess if it works with sudo that's good enough for this
case...

> sudo make install gives the following errors:
> 
> <...>
> running install
> Checking .pth file support in usr/local/lib/python2.7/site-packages/
> /usr/local/opt/python at 2/bin/python2.7 -E -c pass
> TEST FAILED: usr/local/lib/python2.7/site-packages/ does NOT support .pth
> files
> error: bad install directory or PYTHONPATH
> 
> You are attempting to install a package to a directory that is not
> on PYTHONPATH and which Python does not read ".pth" files from.  The
> installation directory you specified (via --install-dir, --prefix, or
> the distutils default setting) was:
> 
>     usr/local/lib/python2.7/site-packages/
> 
> and your PYTHONPATH environment variable currently contains:
> 
>     '/usr/local/lib/python2.7/site-packages/'

Now that is strange.  It seems like the single quotes were not parsed
correctly.  This might take a few more steps of debugging, but can I ask
you to run 'VERBOSE=1 make install'?  The only lines I am looking for
are what is printed right above 'running install', which will be the
exact Python command that is called for the installation.  I think maybe
for some reason a '/' is being dropped here, but I'd have to see the
command to figure out exactly where it's being dropped, then reason
about why.

> I can't figure out what exactly I have to do. The variable PYTHONPATH is
> empty on my system, not sure what is the best way/how to set it.

PYTHONPATH is set by CMake specifically when the install is called here,
so that distutils will actually install.  You can see from the output
above that if PYTHONPATH does not contain the installation directory,
distutils refuses to do the installation. :)  But it looks like for some
reason PYTHONPATH is being set wrong.

> Also, it is not clear why do I have to build with sudo in order to avoid
> the permission issue.

Right, this is not clear to me either.  I don't think this has anything
to do with mlpack though.

-- 
Ryan Curtin    | "And tell the engineers to wipe that stupid smile
ryan at ratml.org | off his face this time."  - Lou


More information about the mlpack mailing list