In my case, using a pre-existing virtualenv did not work in the editor - all modules were marked as unresolved reference (running naturally works, as this is outside of the editor's config, just running an external process (not so easy for debugging)).
Turns out PyCharm did not add the site-packages directory... the fix is to manually add it.
On Pycharm professional 2022.3
Open File -> Settings -> Python Interpreter, open the drop-down and pick "Show All..." (to edit the config) (1), right click your interpreter (2), click "Show Interpreter Paths" (3).
In that screen, manually add the "site-packages" directory of the virtual environment [looks like .../venv/lib/python3.8/site-packages (4) (I've added the "Lib" also, for a good measure); once done and saved, they will turn up in the interpreter paths.

The other thing that won't hurt to do is select "Associate this virtual environment with the current project", in the interpreter's edit box.
Answer from Todor Minakov on Stack OverflowIn my case, using a pre-existing virtualenv did not work in the editor - all modules were marked as unresolved reference (running naturally works, as this is outside of the editor's config, just running an external process (not so easy for debugging)).
Turns out PyCharm did not add the site-packages directory... the fix is to manually add it.
On Pycharm professional 2022.3
Open File -> Settings -> Python Interpreter, open the drop-down and pick "Show All..." (to edit the config) (1), right click your interpreter (2), click "Show Interpreter Paths" (3).
In that screen, manually add the "site-packages" directory of the virtual environment [looks like .../venv/lib/python3.8/site-packages (4) (I've added the "Lib" also, for a good measure); once done and saved, they will turn up in the interpreter paths.

The other thing that won't hurt to do is select "Associate this virtual environment with the current project", in the interpreter's edit box.
If you are using PyCharms CE (Community Edition), then click on:
File->Default Settings->Project Interpreter

See the + sign at the bottom, click on it. It will open another dialog with a host of modules available. Select your package (e.g. requests) and PyCharm will do the rest.
Hey! I just installed some packages using pip (python 3.7) and when i open Pycharm i just can't use those packages - Pycharm says that its not installed or something like that (the red line under the package near the import)
At first i thought that i installed it incorrectly, but when i tried to install it again (all of the packages) then the cmd says that it "satisfied".
I'm very confused, please help me find a way to use those packages.
Thank you all!
python - PyCharm does not recognize modules installed in development mode - Stack Overflow
python - PyCharm does not recognize installed package - Stack Overflow
python - Pycharm does not detect installed installed packages - Stack Overflow
PyCharm not "detecting" modules... possible pip issue?
In PyCharm's settings, you can configure the directories it looks in for installed modules. Maybe it's just looking in the wrong place? The option's rather hidden behind buttons with no name, so it's hard to describe, but this screenshot should give you an idea where to look:
http://imgur.com/PPqxBmE
More on reddit.comIn the project pane, the directory which holds p needs to be marked as source. Available under: Right-click -> "Mark Directory As" -> "Sources Root".
Note: This setting will also add it to PYTHONPATH during execution from the run menu if the corresponding check box for the option is checked in "Edit Configurations" (default).
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 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:
- In your cmd, type
which pythonand 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. - In PyCharm:
Preferences->Project->Python Interpreter - Choose path if listed, or
Show all->+-> find and select path - Now in top right corner of the window, next to run button, select interpeter dropdown and
Edit configuration - Select correct
Python interpreter, give it a few moments PyCharm will figure out yournltkdependency
I would strongly suggest using virtual environment for each project, in order not to mix dependencies.
first uninstall nltk then try to install it from the PyCharm command line using the same interpreter.
So, I've installed xlsxwriter via pip just fine -- scripts run no problem. My issue is that I can't find where the actual files are installed to (because PyCharm IDE doesn't detect that xlsxwriter is actually installed and has that annoying red underline)
So, as you can see in the attached picture, when I run pip uninstall xlsxwriter it is showing that it's installed in \lib\site-packages\xlsxwriter\ but that folder simply does not exist as far as I can tell, not even as a hidden directory.
In the end, I really just want PyCharm to stop underlining modules that are installed, but this appears to be the case with a few different modules and I just want to get to the bottom of it.
http://imgur.com/DCAMRSJ
http://imgur.com/jbxAecT
In PyCharm's settings, you can configure the directories it looks in for installed modules. Maybe it's just looking in the wrong place? The option's rather hidden behind buttons with no name, so it's hard to describe, but this screenshot should give you an idea where to look:
http://imgur.com/PPqxBmE
-
So the modules are installed, it runs but pyCharm says they are not ?
=> pyCharm read your package folder and cache the result. The pyCharm cache must not be up-to-date.
-
Or python does not run and throw an error 'package not there' ?
=> Do you have multiple interpreters (2.7/3.5)? Your project might be using the wrong interpreter

