Error "No module named 'wolframclient.evaluation'" issued
monica1131 opened this issue · 13 comments
I am trying to do some automation using Mathematica in python. I install the package but I encounter an error "No module named 'wolframclient.evaluation'". I have installed the complete package and there is a folder called evaluation in wolframclient.
Can you provide the relevant code snippet that reproduces your issue?
I was going through https://reference.wolfram.com/language/WolframClientForPython/
when I try to import this command
from wolframclient.evaluation import WolframLanguageSession
I get the error I have mentioned above.
Did you run pip install wolframclient
successfully first?
Yes, I did and it was successful.
Do you have more than one python installation, where perhaps one works with pip install and the other one does not? Are you perhaps using a very old python version that may not be supported?
I used pip3 install wolframclient
And what does python --version
return?
Python 2.7.16
Ok, I agree but I use Anaconda which has python 3.6. I'm working on Jupyter Notebook
I highly suspect you have multiple python installations (probably more than two?). When you run pip3 it may simply be installing it somewhere where it can not be found (for example by Anaconda). It's a little hard to debug this for me, and also outside of the scope of this repo issue tracker. If you're using a Jupyter notebook, try to check what python installation it is using, and how to install packages for that specific python.
Correct, there is something wrong with your env. I suggest to do the following:
- in your anaconda notebook run:
>>> import sys
>>> sys.executable
'/usr/local/opt/python/bin/python3.7'
- use that path to directly run pip install from cli, in order to be extra safe please specify the latest released version explicitly.
/usr/local/opt/python/bin/python3.7 -m pip install wolframclient==1.1.4
that should fix your issue, please let me know if this is not helping.
Cheers.
Thank you, the error has been solved. @riccardodivirgilio and @arnoudbuzing