pyre-check
pyre-check copied to clipboard
VSCode + Virtualenv
Environment
OS: OSX 10.13.2 Python: 3.6.4 (in pipenv managed virtual environment) VSCode: 1.23.1
Error
After installing the extension I get the following error in the 'Output' window within VSCode
[Error - 11:58:11] Starting client failed
Launching server using command pyre failed.
Running pyre within the virtual env completes successfully and detects the sample type error.
Have you set your virtual environment in your VS Code config?
{
"python.pythonPath": "/opt/anaconda/envs/tf/bin/python"
}
There's a button on the bottom of the screen that you can click to has this done for you:

I'm having this issue as well with conda environments. Using python 3.6.5.
The python extension automatically detects pipenv virtual environments however the pyre VSCode extension calls the 'pyre' executable in a way that doesn't seem to pick up the detected environment. It behaves as if pyre is being called in the project directory but not within the venv.
For example if I use pyenv local 3.6.4 and then pip install pyre-check and then reload the pyre extension it seems to work (at least once).
I had the same issue and as a work around, I modified the pyre command in the extension to the full path of the pyre executable. The location is in ~/.vscode/extensions/fb-pyre-check.pyre-vscode-0.0.1/out/main.js. You can find it in function activate() under serverOptions.
For whatever reason, VSCode has a hard time finding things in virtualenv. I think this is why many extensions have a config for the path of it's executable.
It works on my computer if I start vs code from a terminal where the venv is activated
Having the same issue with virtualenv activated
I've reproduced this when pyre-check is installed as a poetry dev group dependency as well as when it is installed via pipx
Code: 1.76.2 Poetry (version 1.4.1) Client version: 0.9.18 extension version: v0.0.1 Ubuntu 22.04.2 LTS
Also running into this issue -- it seems like the vscode extension uses the global version of pyre instead of the interpreter configured in vscode. I'd love to use pyre but this is blocking for me, as I'm working on a project with multiple environments.
This is also happening for me, I am hacking around it by adding my virtualenv bin directory to the system PATH, which is not ideal.