On Ubuntu 18.04-x64 I need to install the Pytest library for Python.
I ran the following commands:
pip3 install pytest
pytest --version
I get the following error:
Command 'pytest' not found, but can be installed with:
sudo apt install python-pytest
However, when I run:
pip3 show pytest
I get:
Name: pytest
Version: 4.3.1
...
Location: /home/crispjam/.local/lib/python3.6/site-packages
I decided to move the pytest.py
file from its location in site-packages
to /bin
but that did not solve my problem.
When I run:
pytest --version
I still get:
Command 'pytest' not found, but can be installed with:
sudo apt install python-pytest
Is this not the right way of doing things? Should I instead be concerned with editing $PATH
?
EDIT: I also tried installing pytest
with sudo apt install python-pytest
but that installed an outdated version - 3.3.2
which I cannot use for my project.