Python Forum
Pytest Installed, but VS Code Won’t Access Pytest
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pytest Installed, but VS Code Won’t Access Pytest
#5
(Sep-12-2023, 02:56 PM)AstralWeeks Wrote: What command should I use to download pytest to a particular folder that contains python?
You shall not download at all,this is all done bye pip.
Open cmd and test python and pip command.
C:\Users>cd ..

C:\>python -V
Python 3.11.3

C:\>pip -V
pip 23.1.2 from C:\python311\Lib\site-packages\pip (python 3.11)

C:\>
So it most work like this,if not you most fix you environment variables path.
Then will pip install pytest --upgrade download and install automatic to this Python 3.11.
When this work on command line as posted before in VS Code down in right corner Python interpreter(choose same version).

Quote:e.g. if the test file were calculation.py, when I type import calculation, it comes up with the same error, namely that import "calculation" could not be resolved
That's different when use own modules file most be in Python sys.path or run from same folder as code.
Reply


Messages In This Thread
RE: Pytest Installed, but VS Code Won’t Access Pytest - by snippsat - Sep-12-2023, 03:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pytest mocks anthonyrmoss78 0 499 May-30-2023, 08:28 PM
Last Post: anthonyrmoss78
  script with imports works but pytest gives "ModuleNotFoundError"? Hpao 0 1,635 Jun-27-2021, 08:30 PM
Last Post: Hpao
  How to run a pytest test for each item in a list arielma 0 2,429 Jan-06-2021, 10:40 PM
Last Post: arielma
  Noob warning: trying to use pip to install pytest and pep8 in Command Prompt adifrank 4 5,524 Dec-20-2020, 04:23 AM
Last Post: adifrank
  Error in code tensorflow is installed ErnestTBass 5 6,641 Nov-04-2020, 03:43 PM
Last Post: snippsat
  capture pytest results to a file maiya 2 6,000 Oct-17-2020, 03:42 AM
Last Post: maiya
  pytest, parametrize, neasted list niski1996 0 1,629 Jul-21-2020, 10:36 PM
Last Post: niski1996
  Erreur Code access violation reading 0x00000004 yan_mhb 0 2,416 Jul-10-2020, 02:28 PM
Last Post: yan_mhb
  how to generate html report for each folder using pytest ktrsarath 0 2,255 Jun-30-2020, 05:14 AM
Last Post: ktrsarath
  Pytest and rootdirectory Master_Sergius 4 4,882 Jun-01-2020, 05:05 PM
Last Post: Master_Sergius

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020