importing library

Answered

Hi I am currently trying to write a virtual assistant programme but am having problems importing some libraries. I am running pycharm64 in windows 10 . I have taken the following steps.

At the windows cmd prompt - pip install wxpython (no problems)

then I enter- pip install wolframalpha (no problem)

then I enter - pip install wikipedia (no problem)

I then open pycharm and enter- import wolframalpha (error no module called 'wolframalpha'

I then try - import wikipedia (error no module called 'wikipedia')

Is there some other step I need to take so that pycharm can find these libraries?

Many thanks Simon

 

1 comment
Comment actions Permalink

Hi Simon,

The problem is that you installed them to another interpreter. In cmd, you are using some system interpreter and in PyCharm you are most likely using some virtualenv. So installing some packages from the system terminal doesn't mean that they will appear in your Project Interpreter in PyCharm.

In this situation, you can either configure your system interpreter (the one you are using in cmd) as your Project Interpreter in PyCharm or install those packages to your current Project Interpreter. The second option is better since using system interpreter is not recommended.

See https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html for more info about package management in PyCharm.

0

Please sign in to leave a comment.