Sep-12-2023, 05:15 AM
Hi,
Sorry, I understand questions about installing packages and problems with path directories are common, but I've tried everything and really need help.
I’m starting to learn how to write tests for my code.
I’ve installed pytest on my device using pip.
But VS Code won’t access it. I assume it’s something to do with the path. I’ve tried using different IDEs, but I can’t find one that will let me use pytest without installing it.
When I type "import pytest", VS Code just says:
I have added a path by going into the settings and adding a path to Python > Testing: Pytest Path. But it still doesn't work...
I've tried two possible paths:
C:\Users\user\anaconda3\Lib\site-packages\pytest
C:\Users\user\AppData\Local\Programs\Python\Python311\Scripts\pytest.exe
C:\Users\user\AppData\Local\Programs\Python\Python311\Scripts\pytest
I'm obviously doing some newbie error... e.g. I took the .exe off, but it still won't access it. But I can't find any other possible path...
The second possible path I tried was the answer I got from asking Command Prompt "where pytest".
Any help would be greatly appreciated.
Thanks.
Sorry, I understand questions about installing packages and problems with path directories are common, but I've tried everything and really need help.
I’m starting to learn how to write tests for my code.
I’ve installed pytest on my device using pip.
But VS Code won’t access it. I assume it’s something to do with the path. I’ve tried using different IDEs, but I can’t find one that will let me use pytest without installing it.
When I type "import pytest", VS Code just says:
Quote:"pytest" is not accessed Pylance
I have added a path by going into the settings and adding a path to Python > Testing: Pytest Path. But it still doesn't work...
I've tried two possible paths:
C:\Users\user\anaconda3\Lib\site-packages\pytest
C:\Users\user\AppData\Local\Programs\Python\Python311\Scripts\pytest.exe
C:\Users\user\AppData\Local\Programs\Python\Python311\Scripts\pytest
I'm obviously doing some newbie error... e.g. I took the .exe off, but it still won't access it. But I can't find any other possible path...
The second possible path I tried was the answer I got from asking Command Prompt "where pytest".
Any help would be greatly appreciated.
Thanks.