Import Error When running Unittests with Nosetests python

python

#1

hello , I’m really new to Circle CI , I’ve deployed my first project on but I’m unable to run unittest I’m getting import error even after installation of all dependencies in requirements.txt

here is the traceback of the error I’m getting :
nosetests tests.py
E
======================================================================
ERROR: Failure: ImportError (No module named flask_api)
----------------------------------------------------------------------
Traceback (most recent call last):
File “/home/ubuntu/virtualenvs/venv-2.7.13/lib/python2.7/site-packages/nose/loader.py”, line 418, in loadTestsFromName
addr.filename, addr.module)
File “/home/ubuntu/virtualenvs/venv-2.7.13/lib/python2.7/site-packages/nose/importer.py”, line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File “/home/ubuntu/virtualenvs/venv-2.7.13/lib/python2.7/site-packages/nose/importer.py”, line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File “/home/ubuntu/Memory-Working-Dir/GradePredictorApp/tests.py”, line 5, in
from app import create_app
File “/home/ubuntu/Memory-Working-Dir/GradePredictorApp/app/init.py”, line 2, in
from flask_api import FlaskAPI
ImportError: No module named flask_api

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)

nosetests tests.py returned exit code 1  

I’m sure that the flask api module is install because I can install it when I install requirements

but I think that the tests are not executed inside the same environement but feel confused about it …

Any Help That can give Me the reason of this will be welcomed

here is my circle.yml

this is the configuration file for the deployement of the app

machine:
python:
version: 2.7.13
general:
branches:
only:
- GradePredictorAppBuilding # will build only GradePredictorAppBuilding branch
build_dir: GradePredictorApp/
dependencies:
override:
- pip install -r requirements.txt
test:
override:
- nosetests tests.py #for running the test


#2