Modules not detected / autosuggest no longer appears

Answered

Hi,

Initially I used Pycharm with Python 3.6 and liked the auto-suggest as it showed me which elements/objects were available with whatever modules I was working with.

Something has broken recently when I uninstalled Python 3.6, and installed Anaconda with Python 2.7. I created a new environment in Anaconda for my Python 2.7 install, and set the path to python in Anaconda (C:\ProgramData\Anaconda2\python.exe) as my interpreter.

I can now run a script using the Anaconda command line. But Pycharm's "run" button is unavailable to be clicked on. Most importantly, the modules all appear broken (red underlines and red flags on the right side). And auto-suggest no longer shows the various objects in these modules.

I guess Pycharm is having trouble reading the libraries in my Anaconda environment. Anyone know how to fix this?

I'm running Python 2.7.14, and conda 4.4.11 on Windows 10.

My interpreter settings: https://i.imgur.com/lz1KGqO.jpg
My project structure settings: https://i.imgur.com/dNdGGDG.jpg

I think that my project structure settings may not be correct as they don't seem to include the conda environment (Do I need to add the conda environment as a content root?)

0
2 comments
Avatar
Permanently deleted user

Forgot to mention, I have Pycharm Community Edition, version 2017.3.3

0
Avatar
Permanently deleted user

The issue is solved.

1) I needed to add a conda environment, not a virtual env
2) Pycharm has an open bug with Anaconda detection. This page solved it using a symlink: https://stackoverflow.com/questions/47624777/pycharm-anaconda-installation-is-not-found
3) After adding the symlink and restarting, I was able to add the conda env and this detected the modules, which reenabled autosuggest

0

Please sign in to leave a comment.