4
votes

Having windows 10, pycharm version 4.5.4, python v3.4, django v1.8 I imported a django project existed in virtualenv directory into pycharm. Thus far I've installed several packages through the same virtualenv (using pip) like django-registration-redux etc, all being recognizable by pycharm. I installed pymongo in the same way as all the other packages but pycharm cannot recognize it although the package exists in the site-packages of the virtualenv directory and I can import it using the django manage.py shell.

I tried installing the pymongo globally and this way pycharm could recognize the package.

My question being: what pycharm doesn't recognize the pymongo package that was installed in virtualenv and how can I fix it?

1
try execute "pip freeze" and check if pymongo is listed. Run this command in your activated virtualenv - wolendranh
@wolendranh I tried, it lists the pymongo along with other packages but still pycharm doesn't recognize it - Amir Afianian
Are you sure that you added correct virtual env into Pycharm python interpreters? - wolendranh
@wolendranh You were right, I hadn't configured pycharm to use the virtualenv interpreter. - Amir Afianian
i will add answer than. maybe it will help also someone else.Added. - wolendranh

1 Answers

4
votes

Please check in your virtual environment if that package is really installed:

$ pip freeze
pymongo==<version of installed pymongo>

if it is really installed in your Virtual Environment check PyCharm settings. (Configuring Project interpreter)

Settings => Project: => Project Interpreter

Your Project interpreter should be listed there and selected for current project. If no - select it.
Also all packages installed in virtual environment will be listed there.