0

I just started to learn python3 in the past few days and I was trying to make a virtual assistant. I've tried running this program and I keep getting an error that 'wolframalpha' is an unresolved import even though I have already gone into the command prompt and done a successful "pip install wolframalpha".

import wolframalpha

input = raw_input("Question: ")
app_id = "-I INSERTED MINE HERE -"
client= wolframalpha.Client(app_id)

result= client.query(input)
answer= next(res.results).text # Makes sure wolframalpha doesn't give a graph as an answer

print(answer)
  • Do you have multiple versions of Python installed? – Paul M. Jul 08 '20 at 16:54
  • Yes, I think I have Python 3.7 and 3.8 – katalinablues Jul 08 '20 at 16:59
  • That may be the issue. Verify that the version of Python you are using the execute the script, and the version to which you installed the third-party package are the same. Take a look at [this link](https://stackoverflow.com/a/4910393/10987432) to see examples of how to use `pip` to install packages to specific versions of Python. – Paul M. Jul 08 '20 at 17:04
  • Thank you! I changed my runtime envr to Python 3.8, just a quick question though- is there any way to use python 3.7 with the command prompt? – katalinablues Jul 09 '20 at 16:26
  • If you open the command prompt, and type in `py -0`, it will display a list of all available versions of Python. Then, run the same command again, but this time with the specific version instead of the `-0`, for example `py -3.7-32 ` – Paul M. Jul 09 '20 at 19:29

0 Answers0