I have one virtual environment, where elasticsearch python package was installed.
I want to find, which package has dependency on elasticsearch and did installation in virtual environment.
(.venv)root@test:~# pip freeze | grep elast
elasticsearch==1.4.0.dev0
I tried some solution from show reverse dependencies with pip? but its not worked
(.venv)root@test:~# python
Python 2.7.8 (default, Oct 18 2014, 12:50:18)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pip
>>> package_name = 'elasticsearch'
>>> rev_dep = [pkg.project_name for pkg in pip.get_installed_distributions() if package_name in [requirement.project_name for requirement in pkg.requires()]]
>>> rev_dep
[]
>>>
Path of module return virtual env path.
(.venv)root@test:~# python -c 'import elasticsearch; print elasticsearch.__path__'
['/opt/venvs/.venv/local/lib/python2.7/site-packages/elasticsearch']
I have doubt that elasticsearch debian package might be installed this python package, but not sure.
(.venv)root@test:~# dpkg -l | grep elast
ii elasticsearch 1.2.0 all Open Source, Distributed, RESTful Search Engine
elasticsearchis installed (so you can know whether you're using the system package or not). Please provide the output of:python -c 'import elasticsearch; print elasticsearch.__path__'.