# Cannot import name BoolQuery, swagger-client python

**URL:** <https://discuss.elastic.co/t/cannot-import-name-boolquery-swagger-client-python/141612>\
**Category:** Elasticsearch\
**Created:** [July 25, 2018, 3:29pm UTC](https://discuss.elastic.co/t/cannot-import-name-boolquery-swagger-client-python/141612 "2018-07-25T15:29:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tarp/32/51884_2.png) [@tarp](https://discuss.elastic.co/u/tarp)\
**Post date:** [July 25, 2018, 3:29pm UTC](https://discuss.elastic.co/t/cannot-import-name-boolquery-swagger-client-python/141612/1 "2018-07-25T15:29:31Z")

</div>

Hi,  
I'm trying out the swagger client to connect with ECE using python. For now I'm attempting this on my windows workstation running python 2.7.  
The swagger-client installs but trying to import it yields this error.  
$ python  
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32  
Type "help", "copyright", "credits" or "license" for more information.

> > > import swagger\_client  
> > > Traceback (most recent call last):  
> > > File "", line 1, in   
> > > File "swagger\_client\__init_\_.py", line 19, in   
> > > from swagger\_client.api.clusters\_elasticsearch\_api import ClustersElasticsearchApi  
> > > File "swagger\_client\api\__init_\_.py", line 6, in   
> > > from swagger\_client.api.clusters\_elasticsearch\_api import ClustersElasticsearchApi  
> > > File "swagger\_client\api\clusters\_elasticsearch\_api.py", line 21, in   
> > > from swagger\_client.api\_client import ApiClient  
> > > File "swagger\_client\api\_client.py", line 27, in   
> > > import swagger\_client.models  
> > > File "swagger\_client\models\__init_\_.py", line 32, in   
> > > from swagger\_client.models.bool\_query import BoolQuery  
> > > File "swagger\_client\models\bool\_query.py", line 19, in   
> > > from swagger\_client.models.query\_container import QueryContainer # noqa: F401,E501  
> > > File "swagger\_client\models\query\_container.py", line 19, in   
> > > from swagger\_client.models.bool\_query import BoolQuery # noqa: F401,E501  
> > > ImportError: cannot import name BoolQuery

Any ideas on this?

---

<div class="post-metadata">

**Author:** ![tarp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tarp/32/51884_2.png) [@tarp](https://discuss.elastic.co/u/tarp)\
**Post date:** [July 25, 2018, 9:01pm UTC](https://discuss.elastic.co/t/cannot-import-name-boolquery-swagger-client-python/141612/2 "2018-07-25T21:01:28Z")

</div>

I re-read the doc on setting up the swagger client, and I posted this issue to the swagger github, like your article recommends.

> <https://github.com/swagger-api/swagger-codegen/issues/8483>

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 8, 2018, 9:01pm UTC](https://discuss.elastic.co/t/cannot-import-name-boolquery-swagger-client-python/141612/3 "2018-08-08T21:01:30Z")

</div>

Closed on August 8, 2018, 9:01pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
