PJLink
PJLink copied to clipboard
Install failing on MacOS
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)]
What's the error you're getting? The flow works for me on the same MacOS. Is it an issue in the InstallPython
step?
Oh shoot have you run <<PJLink`
? I can't believe I forgot that step in the README...
<< PJLink`
ker = InstallPython[];
warns:
StartProcess::pnfd: Program python3 not found. Check Environment["PATH"].
and then hangs
@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
It's looking for python3, which isn't a thing on my machine - just python.
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).
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?
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.