PJLink icon indicating copy to clipboard operation
PJLink copied to clipboard

Install failing on MacOS

Open msollami opened this issue 6 years ago • 8 comments

I'm on v11.3 with MacOS 10.13.6. Doesn't seem to install as the Readme says:

In[82]:= PacletInstall["PJLink","Site"->"http://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer"]
Out[82]= Paclet[PJLink,1.0.0,<>]
In[83]:= ker=InstallPython[];
In[84]:= PyEvaluateString["import numpy as np"];
PyEvaluateString["np.random.rand(5, 5, 5)"]~Short~3
Out[85]//Short= PyEvaluateString[np.random.rand(5, 5, 5)]

msollami avatar Oct 01 '18 15:10 msollami

What's the error you're getting? The flow works for me on the same MacOS. Is it an issue in the InstallPython step?

b3m2a1 avatar Oct 01 '18 16:10 b3m2a1

Oh shoot have you run <<PJLink` ? I can't believe I forgot that step in the README...

b3m2a1 avatar Oct 01 '18 16:10 b3m2a1

<< PJLink`
ker = InstallPython[];

warns:

StartProcess::pnfd: Program python3 not found. Check Environment["PATH"].

and then hangs

msollami avatar Oct 01 '18 18:10 msollami

@msollami Hmm... I think I've hit that one for others before. If I had to guess there's something weird going on with the .so file compilation. If you're willing to do a bit of testing, try

DeleteFile@
 FileNames["*.so", 
   PacletFind["PJLink"][[1]]["Location"], Infinity][[1]]

and try again

b3m2a1 avatar Oct 01 '18 18:10 b3m2a1

It's looking for python3, which isn't a thing on my machine - just python.

msollami avatar Oct 01 '18 19:10 msollami

Ahh. That would be an issue. Do you have python 3 installed? Another thing I forgot to mention in the readme is that this is a python3 package as the python C interface is very different for 2 and for 3. (I'll add that).

b3m2a1 avatar Oct 01 '18 20:10 b3m2a1

I use conda inside zsh:

 ➜ conda activate py36
(py37) ➜ which python
/Users/msollami/anaconda3/envs/py36/bin/python

The exact version is:

Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 11:07:29) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin

Is there a way to tell your package to use this executable or is it looking for some brew installation?

msollami avatar Oct 02 '18 19:10 msollami

Yeah try:

InstallPython["python"]

where the first argument is the executable to use or a version string. Conda's been a problem for compilation and things in the past but hopefully the fixes I've tried to get in place will work.

b3m2a1 avatar Oct 02 '18 21:10 b3m2a1