Pycharm Doesn't Recognise Installed Module

PyCharm does not recognize modules installed in development mode

As of Pycharm 2016.1.4 (professional edition), it seems that opening a different project (e.g. through Open Recent) and then opening the original one makes Pycharm reindex the installed packages and hence recognize the develop-installed packages.

This is enough for me.

PyCharm does not recognize installed package

PyCharm does not use the same python interpreter as the one you installed package for.

As @crissal said, you can use PyCharm package manager to install packages, or configure it to recognize the one you already have:

  1. In your cmd, type which python and you'll get something like /usr/bin/python (on win it might be different but doesn't matter). That's the path of your default interpeter.
  2. In PyCharm: Preferences -> Project -> Python Interpreter
  3. Choose path if listed, or Show all -> + -> find and select path
  4. Now in top right corner of the window, next to run button, select interpeter dropdown and Edit configuration
  5. Select correct Python interpreter, give it a few moments PyCharm will figure out your nltk dependency

I would strongly suggest using virtual environment for each project, in order not to mix dependencies.

Module not found error in PyCharm, but it is installed as an Anaconda package

Apparently the naming of the selection depends on the operating system, but the Python interpreter can be selected as follows:

  • Menu FilePreferencesProjectPython Interpreter (macOS)
  • Menu FileSettingsProjectPython Interpreter (Windows and Linux)

Using the dropdown, select the right Python interpreter. Depending on your OS and setup, this can be the default interpreter (e.g., ~/anaconda3/bin/python) or the interpreter corresponding to the Conda environment of your choice (e.g., C:\users\username\.conda\envs\projectname\python.exe).

Screenshot of PyCharm Settings

Now all the packages installed with Anaconda should be listed.

Screenshot of PyCharm Preferences listing packages installed

PyCharm modules not found

It sounds like you have an anaconda environment. To install packages to your python environment in anaconda, follow the documentation.

Basically try installing packages like conda install -n Abitt scipy. After installing the package, it should show up in your project interpreter settings.



Related Topics



Leave a reply



Submit