-
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
Support pipenv #404
Comments
Just as a suggestion, it would be good if vsc could detect virtualenv that Pipenv creates, and use that for completion etc. If it helps, |
It'd vastly improve my workflow if VSCode automatically detected the |
It looks like @kennethreitz is developing a library that could potentially be useful (although if we have to work through TypeScript I'm not sure how much it would buy us to have a Python library versus the CLI): https://github.com/kennethreitz/pipenvlib |
@MikhailArkhipov Currently we don't have any search directories for Windows, its only for Unix systems. |
Yeah, working on it |
Also realize that with pipenv there is a single virtual environment per directory, so we could automatically select it if found as appropriate. |
I would really appreciate this feature. In particular, to allow it to autodiscover the python executable, pip executable, and PATH for my virtualenv, so that I don't need to worry about launching vscode via pipenv in order to get it to use a project-specific version of the linter I'm using, etc. |
@ryanhiebert if you add a user or workspace setting to point to your .venv python path, VS Code will pick up your linter, interpreter, etc on it's own - you don't need to launch it from within pipenv. Something like: {
"python.pythonPath": "${workspaceRoot}/.venv/bin/python",
} |
The feature amounts to this:
Anything else? |
|
Yes
Yes. It should. I haven't tested this though.
|
@brettcannon, @DonJayamanne - yes, this is exaclty what I have atm :-) Basically pyenv is checked first and always wins. Working on auto-set and testing |
@MikhailArkhipov |
It is a good question. Currently one can still override interpreter path manually in settings. If nothing is there then pipenv is used. This may come useful if one wants to try different interpreter without actually removing or modifying pipenv environment. |
@MikhailArkhipov Maybe a flag for that override right now I have my interpreter path set to a default which if I was in a pipenv project I'd want overridden to use the pipenv interpreter. It'd also be quite neat if we had a command for installing pipenv packages. e.g. cmd+shift+p <dev yes/no> |
Thanks for this, @repentsinner . I had assumed that the process PATH would need to be updated, I didn't expect that just setting the interpreter would be sufficient. I guess it uses the pythonpath instead, which is cool. It's just what I needed. |
@naphta package installation would be a separate issue as we would have to solve that for pip and conda as well. |
I updated to 2018.2.0 but my Pipfiles are not picked up (I also tried to rename it to pipfile). In the debug console I don't see any error/warning (apart the missing packages due to the fact that environment is not activated) and the select interpreter command is listing only the system pythons. I'm on OSX Sierra with vscode 1.21, pipenv installed via homebrew Can I do anything to help tracking down the problem? --sergio |
Same for me. I read the announcement https://blogs.msdn.microsoft.com/pythonengineering/2018/03/08/python-in-visual-studio-code-feb-2018-release/, but the detection of the pipenv venv does not work. Tried already with three projects/directories using pipenv |
@guaguanco not sure what you mean by "Pipfiles are not picked up"? @brot please open a new issue as we need details about your setup that are requested in the new issue template. |
Getting a similar issue to @guaguanco and @brot. Open up VSCode in a folder which has a Pipfile and nothing is being detected. I didn't get prompted to upgrade the Python plugin after I reinstalled (not sure if that's now managed in the regular upgrade process now) I'm also using Version: |
@brot @guaguanco @naphta We think someone found the bug and we are working on a |
|
And we have opened #1007 to make sure this specific bug isn't a problem in the future. |
@brettcannon The issue seems still exists on 2018.2.1. I am using |
@frostming please could you create a separate Issue. |
Same problem as @frostming Also on a mac. |
@frostming @eomeara please could you create a separate Issue. |
can someone just lock this issue? we are definitely past the point of having any relevant conversation happen here. |
Not quite sure how this would look (use
pipenv
whenever we prompt users to install something on their behalf?).Fork of #301
The text was updated successfully, but these errors were encountered: