I am unable to use nose (nosetests) in a virtualenv project - it can't seem to find the packages installed in the virtualenv environment.
The odd thing is that i can set
test_suite = 'nose.collector'
in setup.py and run the tests just fine as
python setup.py test
but when running nosetests straight, there are all sorts of import errors.
I've tried it with both a system-wide installation of nose and a virtualenv nose package and no luck.
Any thoughts?
Thanks!!
These are almost completely interchangeable, the difference being that virtualenv supports older python versions and has a few more minor unique features, while venv is in the standard library.
Virtualenv has been deprecated in Python 3.8.
virtualenv creates a folder which contains all the necessary executables to use the packages that a Python project would need. Now after creating virtual environment, you need to activate it. Remember to activate the relevant virtual environment every time you work on the project.
You need to have a copy of nose installed in the virtual environment. In order to force installation of nose into the virtualenv, even though it is already installed in the global site-packages, run pip install
with the -I
flag:
(env1)$ pip install nose -I
From then on you can just run nosetests
as usual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With