-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repeatedly prompts: Test framework pytest is not installed. Install? #2512
Comments
What is the output from the |
Could be related to this issue: Looking again for the logs I see in the "Python Test Logs" this: but this file does exists: |
pipenv install pytest --dev Adding pytest to Pipfile's [dev-packages]… |
Running "python -c "import pytest" from the terminal in vscode does not cause an error |
Got the exact same error, what fixed it for me was to create a VS Code workspace containing the folder and using "Open Workspace" instead of using "Open Folder" like I usually do. |
I'll try to verify this. |
This comment has been minimized.
This comment has been minimized.
I had the same issue and got it fixed when I realized that my workspace contained a folder with unit tests from another project. I removed the folder from the workspace and then the error went away and it started working. |
@dazzag24 I can't reproduce. Any chance you can provide a zip of some code that exhibits the problem? And when you try and run that |
I've had this issue too, took the following extra steps, but haven't succeeded yet:
I'm currently working on the assumption that it's an issue with either a full system path, or spawning in the context of a virtual env (in my case a pipenv). Will post further if I have any luck. |
@owencjones when you did the spawn() call with your own Node script did you set the shell environment on? If there's something environment-specific to make it work that would be a difference as we don't execute through the shell. And thanks for trying to help! |
@brettcannon shell environment as in virtualenv/pipenv etc? No. I don't know of any reason that a I found that, in my case, I was having some issues with another extension that I have to switch pipenv environments, so essentially the environment was being switched twice. In addition, my That's my fix, but I think that it's going to differ between people - In my case, this helped:
Not an out and out fix, but a good approach to debugging these problems. We could do with finding the real cause of the failed spawn, which I think is because the spawn is working out an module to run, in Could be that this issue can be avoided by giving the path to the module, not the bin file, and maybe rewording the setting to reflect this, or having 2 settings, one for the binary, and one for the module, either of which could be used. I'd write this and put in a PR, but I've pretty much exhausted my time on this. |
@owencjones I was actually asking about the |
@brettcannon Ah right, well no, I didn't supply any specific options. It's calling an absolute path though, so I don't think that should be the issue. Code below:
It runs pytest fine and then exits with errorlevel 0. somewhat irrelevant if you're not using |
Please let us know how both work out. |
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on then we will be happy to re-open this issue to pick up where we left off. |
Environment data
VS Code version:
Version: 1.27.1
Commit: 5944e81f3c46a3938a82c701f96d7a59b074cfdc
Date: 2018-09-06T09:21:47.222Z
Electron: 2.0.7
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64
Extension version (available under the Extensions sidebar): 2018.8.0
OS and version: Linux Ubuntu 16.04
Python version (& distribution if applicable, e.g. Anaconda): Python 3.5.2
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pipenv
Relevant/affected Python packages and their versions: XXX
Actual behavior
VSCode repeatedly asks: Test framework pytest is not installed. Install?
Yes is selected and it used pipenv install --dev pytest to install which succeeds.
Have said yes several times and yet it is still unable to find pytest.
Expected behavior
After installing pytest it should detect pytest and detect test folders.
Steps to reproduce:
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
)The text was updated successfully, but these errors were encountered: