# Installed Python modules do not seem to be accessible

**URL:** <https://discuss.circleci.com/t/installed-python-modules-do-not-seem-to-be-accessible/20469>\
**Category:** Programming Languages\
**Tags:** python\
**Created:** [March 4, 2018, 4:38pm UTC](https://discuss.circleci.com/t/installed-python-modules-do-not-seem-to-be-accessible/20469 "2018-03-04T16:38:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![taggedzi](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/taggedzi/32/17931_2.png) [@taggedzi](https://discuss.circleci.com/u/taggedzi)\
**Post date:** [March 4, 2018, 4:38pm UTC](https://discuss.circleci.com/t/installed-python-modules-do-not-seem-to-be-accessible/20469/1 "2018-03-04T16:38:51Z")

</div>

In my Ci process I have Python requirements.txt setup to install mock and coverage packages. In CircleCi it runs the install portion without errors. How ever when I try to access “coverage” it tells me “No module named coverage”. I would greatly appreciate any help in sorting this out. I figure it is probably something pretty simple.

This is a fairly small project and it is working locally. Unfortunately locally I’m running on a Windows Platform. I have tried rebuilding with and without cache.

Contents of my requirements.txt file:

```
mock>=2.0.0
coverage>=4.5.1`

```

Here is the install dependency step output:

> #!/bin/bash -eo pipefail  
> python3 -m venv venv  
> . venv/bin/activate  
> pip install -U pip setuptools virtualenv  
> pip install -r requirements.txt
> 
> Requirement already up-to-date: pip in ./venv/lib/python3.6/site-packages  
> Collecting setuptools  
> Downloading setuptools-38.5.1-py2.py3-none-any.whl (489kB)  
> 98% |███████████████████████████████▍| 481kB 31.4MB/s eta 0:00:01 100% |████████████████████████████████| 491kB 2.2MB/s  
> Collecting virtualenv  
> Downloading virtualenv-15.1.0-py2.py3-none-any.whl (1.8MB)  
> 50% |████████████████ | 911kB 34.1 100% |████████████████████████████████| 1.8MB 841kB/s  
> Installing collected packages: setuptools, virtualenv  
> Found existing installation: setuptools 28.8.0  
> Uninstalling setuptools-28.8.0:  
> Successfully uninstalled setuptools-28.8.0  
> Successfully installed setuptools-38.5.1 virtualenv-15.1.0  
> Requirement already satisfied: mock\>=2.0.0 in ./venv/lib/python3.6/site-packages (from -r requirements.txt (line 1))  
> Requirement already satisfied: coverage\>=4.5.1 in ./venv/lib/python3.6/site-packages (from -r requirements.txt (line 2))  
> Requirement already satisfied: six\>=1.9 in ./venv/lib/python3.6/site-packages (from mock\>=2.0.0-\>-r requirements.txt (line 1))  
> Requirement already satisfied: pbr\>=0.11 in ./venv/lib/python3.6/site-packages (from mock\>=2.0.0-\>-r requirements.txt (line 1))

Here is the call failure step:

> #!/bin/bash -eo pipefail  
> python -m coverage run --rcfile=…/coverage.cfg -m unittest discover
> 
> /usr/local/bin/python: No module named coverage  
> Exited with code 1

I’ve tried at least 10 different ways to get this to work. Here are some of the details of what I’m using:

> I am using CircleCi 2.0  
> I am using Python 3  
> I am using the circleci/python:3.6.1 Docker image

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [March 5, 2018, 11:36am UTC](https://discuss.circleci.com/t/installed-python-modules-do-not-seem-to-be-accessible/20469/2 "2018-03-05T11:36:53Z")

</div>

> [@taggedzi](#):
>
> ```
> --rcfile=…/coverage.cfg
> 
> ```

I don’t know if this is related, but you have the ellipsis (`…`) character in that filename. That doesn’t look right at all.

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [March 5, 2018, 11:38am UTC](https://discuss.circleci.com/t/installed-python-modules-do-not-seem-to-be-accessible/20469/3 "2018-03-05T11:38:02Z")

</div>

> [@taggedzi](#):
>
> ```
> coverage>=4.5.1`
> 
> ```

You also have a backtick here, is that right?

---

<div class="post-metadata">

**Author:** ![taggedzi](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/taggedzi/32/17931_2.png) [@taggedzi](https://discuss.circleci.com/u/taggedzi)\
**Post date:** [March 5, 2018, 12:57pm UTC](https://discuss.circleci.com/t/installed-python-modules-do-not-seem-to-be-accessible/20469/4 "2018-03-05T12:57:54Z")

</div>

Yeah, I finally got things working late last night I had to restructure the repo a fair bit to get it setup right. In the end I discovered there problem was I needed to run the vertual environment set up before calling it. Then it worked fine.

---

<div class="post-metadata">

**Author:** ![taggedzi](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/taggedzi/32/17931_2.png) [@taggedzi](https://discuss.circleci.com/u/taggedzi)\
**Post date:** [March 5, 2018, 12:58pm UTC](https://discuss.circleci.com/t/installed-python-modules-do-not-seem-to-be-accessible/20469/5 "2018-03-05T12:58:58Z")

</div>

Lol I thought that was a spec on my monitor and glanced it over thank you for pointing it out

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [March 19, 2018, 7:22pm UTC](https://discuss.circleci.com/t/installed-python-modules-do-not-seem-to-be-accessible/20469/7 "2018-03-19T19:22:06Z")

</div>

> [@AppJetty](#):
>
> thanks for sharing , its very useful…

Please don’t spam here. I’ll report your message, and hopefully your account will be deleted.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:33am UTC](https://discuss.circleci.com/t/installed-python-modules-do-not-seem-to-be-accessible/20469/8 "2018-06-18T11:33:15Z")

</div>


