# ImportError: No module named ansible.constants

**URL:** <https://forum.ansible.com/t/importerror-no-module-named-ansible-constants/27158>\
**Category:** Ansible Project\
**Created:** [March 29, 2018, 10:18pm UTC](https://forum.ansible.com/t/importerror-no-module-named-ansible-constants/27158 "2018-03-29T22:18:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Wick1](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@John\_Wick1](https://forum.ansible.com/u/John_Wick1)\
**Post date:** [March 29, 2018, 10:18pm UTC](https://forum.ansible.com/t/importerror-no-module-named-ansible-constants/27158/1 "2018-03-29T22:18:02Z")

</div>

Un-tar ansible from [http://releases.ansible.com/ansible/](http://releases.ansible.com/ansible/)

when typeing ansible -version from terminal got the below error

line 40, in

import ansible.constants as C

ImportError: No module named ansible.constants

---

<div class="post-metadata">

**Author:** ![Pshem\_Kowalczyk](https://avatars.discourse-cdn.com/v4/letter/p/e480ec/32.png) [@Pshem\_Kowalczyk](https://forum.ansible.com/u/Pshem_Kowalczyk)\
**Post date:** [March 29, 2018, 10:28pm UTC](https://forum.ansible.com/t/importerror-no-module-named-ansible-constants/27158/2 "2018-03-29T22:28:23Z")

</div>

If you’re not using pip or other package manger you have to setup your paths:

[http://docs.ansible.com/ansible/latest/installation\_guide/intro\_installation.html#tarballs-of-tagged-releases](http://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#tarballs-of-tagged-releases)

```auto
source ./hacking/env-setup

```

kind regards  
Pshem

---

<div class="post-metadata">

**Author:** ![John\_Wick1](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@John\_Wick1](https://forum.ansible.com/u/John_Wick1)\
**Post date:** [March 29, 2018, 11:11pm UTC](https://forum.ansible.com/t/importerror-no-module-named-ansible-constants/27158/3 "2018-03-29T23:11:27Z")

</div>

After source ./hacking/env-setup getting below error

line 40, in

from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError

ImportError: No module named ansible.errors
