admin管理员组

文章数量:1320864

Python appears to be in my local programs:

C:\Users\Owner>where python

C:\Users\Owner\AppData\Local\Programs\Python\Python313\python.exe C:\Users\Owner\AppData\Local\Microsoft\WindowsApps\python.exe

But my pip install put pytest in 'roaming' instead of 'local':

PS C:\Users\Owner> python -m pip install pytest

Requirement already satisfied: pytest in c:\users\owner\appdata\roaming\python\python313\site-packages (8.3.4)

When I run pytest from the folder with my file, I get:

PS C:\Users\Owner\Desktop\python_work\chapter_11> pytest

pytest : The term 'pytest' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Is this because pytest and python are in different folders? If so, how do I fix it?

If not, what is the problem?

本文标签: pythonIs pytest not working because it is installed in the wrong folderStack Overflow