Skip to content
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 poetry virtual environments #8372

Closed
wy193777 opened this issue Nov 4, 2019 · 70 comments
Closed

Support poetry virtual environments #8372

wy193777 opened this issue Nov 4, 2019 · 70 comments
Assignees
Labels
area-environments Features relating to handling interpreter environments feature-request

Comments

@wy193777
Copy link

wy193777 commented Nov 4, 2019

Environment data

Version: 1.39.2
Commit: 6ab598523be7a800d7f3eb4d92d7ab9a66069390
Date: 2019-10-15T15:33:40.634Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 5.3.0-19-generic

  • Jedi or Language Server? Language Server
    poetry version: 1.0.0b2

Expected behaviour

Show poetry virtualenvs in ~/.cache/pypoetry/virtualenvs

Actual behaviour

Virtualenvs in above not been shown.

Steps to reproduce:

  1. Install poetry: pip install poetry.
  2. Create a project with poetry init.
  3. Activate the virtualenv with . ~/.cache/pypoetry/virtualenvs/<youprojectname>-b7g26Unn-py3.7/bin/activate
  4. Add ~/.cache/pypoetry/virtualenvs, ~/.cache/pypoetry/, ~/.cache/to settings -> Python: Venv Folders and Python: Venv Path.

Logs

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

Info Python Extension: 2019-11-04 15:27:03: Get Interpreters in CacheableLocatorService, Class name = m, completed in 1ms, Arg 1: <Uri:/home/shenghang/code/eazybi-jira-connector>, Return Value: [{"architecture":3,"path":"/home/shenghang/.virtualenvs/jama-export-import-tool-_YLULkJE/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.virtualenvs/jama-export-import-tool-_YLULkJE","fileHash":"801aecc5bc0ac396450874d6a2618e725b225943dcd1991e7565ae7e184c73c1ea8ad76915df67d4959b35d9b81a19b663c8d669d285b7b4b73f752db7a286ad","envName":"jama-export-import-tool-_YLULkJE","type":"VirtualEnv"},{"architecture":3,"path":"/home/shenghang/.virtualenvs/jama-export-import-tool-_YLULkJE/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.virtualenvs/jama-export-import-tool-_YLULkJE","fileHash":"801aecc5bc0ac396450874d6a2618e725b225943dcd1991e7565ae7e184c73c1ea8ad76915df67d4959b35d9b81a19b663c8d669d285b7b4b73f752db7a286ad","envName":"jama-export-import-tool-_YLULkJE","type":"VirtualEnv"},{"architecture":3,"path":"/home/shenghang/.virtualenvs/jama-export-import-tool-_YLULkJE/bin/python3.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.virtualenvs/jama-export-import-tool-_YLULkJE","fileHash":"801aecc5bc0ac396450874d6a2618e725b225943dcd1991e7565ae7e184c73c1ea8ad76915df67d4959b35d9b81a19b663c8d669d285b7b4b73f752db7a286ad","envName":"jama-export-import-tool-_YLULkJE","type":"VirtualEnv"},{"architecture":3,"path":"/home/shenghang/.virtualenvs/py-jama-rest-client-v9zcyaOA/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.virtualenvs/py-jama-rest-client-v9zcyaOA","fileHash":"bf9fe6e663bd6167746c037dfb451146a4de3d1dcc969fc6c1bb9141c99dabed54aa5918808277119114cb72939eadde5480ea8d549b727510315422f731b7bb","envName":"py-jama-rest-client-v9zcyaOA","type":"VirtualEnv"},{"architecture":3,"path":"/home/shenghang/.virtualenvs/py-jama-rest-client-v9zcyaOA/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.virtualenvs/py-jama-rest-client-v9zcyaOA","fileHash":"bf9fe6e663bd6167746c037dfb451146a4de3d1dcc969fc6c1bb9141c99dabed54aa5918808277119114cb72939eadde5480ea8d549b727510315422f731b7bb","envName":"py-jama-rest-client-v9zcyaOA","type":"VirtualEnv"},{"architecture":3,"path":"/home/shenghang/.virtualenvs/py-jama-rest-client-v9zcyaOA/bin/python3.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.virtualenvs/py-jama-rest-client-v9zcyaOA","fileHash":"bf9fe6e663bd6167746c037dfb451146a4de3d1dcc969fc6c1bb9141c99dabed54aa5918808277119114cb72939eadde5480ea8d549b727510315422f731b7bb","envName":"py-jama-rest-client-v9zcyaOA","type":"VirtualEnv"},{"architecture":3,"path":"/home/shenghang/.virtualenvs/python-nvconnect-Oacfg-Or/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.15-candidate","major":2,"minor":7,"patch":15,"prerelease":["candidate"],"build":[],"version":"2.7.15-candidate"},"sysPrefix":"/home/shenghang/.virtualenvs/python-nvconnect-Oacfg-Or","fileHash":"ca43f294ba471e755add5a556ea3b51a7b2a76cf0edfc146d5c5d1107a78326b13fa614d84588759bdc71186036ba3f5853714d36aec734009ea5d5a9709ac85","envName":"python-nvconnect-Oacfg-Or","type":"VirtualEnv"},{"architecture":3,"path":"/home/shenghang/.virtualenvs/python-nvconnect-Oacfg-Or/bin/python2","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.15-candidate","major":2,"minor":7,"patch":15,"prerelease":["candidate"],"build":[],"version":"2.7.15-candidate"},"sysPrefix":"/home/shenghang/.virtualenvs/python-nvconnect-Oacfg-Or","fileHash":"ca43f294ba471e755add5a556ea3b51a7b2a76cf0edfc146d5c5d1107a78326b13fa614d84588759bdc71186036ba3f5853714d36aec734009ea5d5a9709ac85","envName":"python-nvconnect-Oacfg-Or","type":"VirtualEnv"},{"architecture":3,"path":"/home/shenghang/.virtualenvs/python-nvconnect-Oacfg-Or/bin/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.15-candidate","major":2,"minor":7,"patch":15,"prerelease":["candidate"],"build":[],"version":"2.7.15-candidate"},"sysPrefix":"/home/shenghang/.virtualenvs/python-nvconnect-Oacfg-Or","fileHash":"ca43f294ba471e755add5a556ea3b51a7b2a76cf0edfc146d5c5d1107a78326b13fa614d84588759bdc71186036ba3f5853714d36aec734009ea5d5a9709ac85","envName":"python-nvconnect-Oacfg-Or","type":"VirtualEnv"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/2.7/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.0-final","major":2,"minor":7,"patch":0,"prerelease":["final"],"build":[],"version":"2.7.0-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/2.7","fileHash":"4c28b6da2e8af0551a5a2138de91aaa6bc3b13f233e03a4119b397b7c5c84864bfec00ce33a45d158e8668632b6ac5e9bc0d6dbc9a7037a8ec222681fa3fbd6d","envName":"2.7","type":"Pyenv"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/2.7/bin/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.0-final","major":2,"minor":7,"patch":0,"prerelease":["final"],"build":[],"version":"2.7.0-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/2.7","fileHash":"4c28b6da2e8af0551a5a2138de91aaa6bc3b13f233e03a4119b397b7c5c84864bfec00ce33a45d158e8668632b6ac5e9bc0d6dbc9a7037a8ec222681fa3fbd6d","envName":"2.7","type":"Pyenv"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/3.7.3/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.7.3","fileHash":"b86fc7970bb16ce62d316bf8d5030752c77bf6ff34dc7bd98038105a4e2bc45b722bda996bd50825223e4961bdfc3b2757fdc268a83ef3ccffbbac32cbba9b0e","envName":"3.7.3","type":"Pyenv"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/3.7.3/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.7.3","fileHash":"2414cdbe39641f56d09759395984b124be5831ee05931962264d6bdb043a069aabddf05d870e60ab3de8459046d18d02ecfe103459abd166f135f8bc5214c4c8","envName":"3.7.3","type":"Pyenv"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/3.7.3/bin/python3.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.7.3","fileHash":"c4b884b81e5324207c811c4bd013032a4c9ead5b3212a5cf5507d293eefb233918585c12da4c6286cabe7b3b295bb868ead17f0c91fd81cbc6c40c082fe5aec3","envName":"3.7.3","type":"Pyenv"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/3.8.0/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.8.0-final","major":3,"minor":8,"patch":0,"prerelease":["final"],"build":[],"version":"3.8.0-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.8.0","fileHash":"76f805ffe5322ff60dc66572f08d2ce0f489b41c4580e542a7df39f2bc3307dfaeb897cc7b318e9ef95b682303a524dde266750c1d612e3f1ba6be4f246ee87a","envName":"3.8.0","type":"Pyenv"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/3.8.0/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.8.0-final","major":3,"minor":8,"patch":0,"prerelease":["final"],"build":[],"version":"3.8.0-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.8.0","fileHash":"1df9b91aa61154f05312550f1b0349fac58b5430e74533c41faedf6b7c622a080401c2b240c776835c7641f3b0260d020f08766e5d8eb4cec46817c64c09c0ca","envName":"3.8.0","type":"Pyenv"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/3.8.0/bin/python3.8","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.8.0-final","major":3,"minor":8,"patch":0,"prerelease":["final"],"build":[],"version":"3.8.0-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.8.0","fileHash":"527e9ba790266e784c8d2b5295445c7c8388d723e352070028d96cbdfb35739b43a6f0cc61f1b5316190852788ad28a82cbf60767eabb165924d0cbe0c31dd41","envName":"3.8.0","type":"Pyenv"}]
[Extension Host] Info Python Extension: 2019-11-04 15:27:03: Get Interpreters in CacheableLocatorService, Class name = m, completed in 3ms, Arg 1: <Uri:/home/shenghang/code/eazybi-jira-connector>, Return Value: [{"architecture":3,"path":"/home/shenghang/.pyenv/shims/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.7.3","fileHash":"9918974580d7464e82595565f6ba1f08c2174d332a61f5f134080bde0a7295c09e68f51d065aa67a1aab113ea61e2cbfd89f93cb86d11284d24ccb3ab66a28cf","type":"Unknown"},{"architecture":3,"path":"/home/shenghang/.pyenv/shims/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-candidate","major":2,"minor":7,"patch":17,"prerelease":["candidate"],"build":[],"version":"2.7.17-candidate"},"sysPrefix":"/usr","fileHash":"199b9a85de8b2904a2e4c95ad4aa5e185b17d06bc0b6e0fdf8b859df64a299ba1e047fafb924e6d5dd550830c7404d2132a5b68b3f48148af80a478fc7378cea","type":"Unknown"},{"architecture":3,"path":"/home/shenghang/.pyenv/shims/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.7.3","fileHash":"fcc9d47c6772fe598b319da4149e46dbdc6cc5956a44e207a9b77d2f4333830b668975c286bc0c88471e753a869fc3cf8f61f7c31137cc70f0977abc4e218c7d","type":"Unknown"},{"architecture":3,"path":"/home/shenghang/.pyenv/shims/python3.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.7.3","fileHash":"fcc9d47c6772fe598b319da4149e46dbdc6cc5956a44e207a9b77d2f4333830b668975c286bc0c88471e753a869fc3cf8f61f7c31137cc70f0977abc4e218c7d","type":"Unknown"},{"architecture":3,"path":"/home/shenghang/.pyenv/shims/python3.8","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.8.0-final","major":3,"minor":8,"patch":0,"prerelease":["final"],"build":[],"version":"3.8.0-final"},"sysPrefix":"/usr","fileHash":"e456d6ee14622ce284dcbe81c3bdf40e802415c5b22a171c84016b85b926ed94ebff6cbaa609c0b7120483579f689f50a40f88d6f97500ace23ca8603de677f2","type":"Unknown"},{"architecture":3,"path":"/usr/local/bin/python3.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/usr/local","fileHash":"58fa080cefcf174f0e9c09ec206bead030f8bc3d33ede1ae426c452221d009fed73efc28e15296c6e8a46016e65273adfd8a25520d05b4423ceb5f3e2bbb7ae9","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-candidate","major":2,"minor":7,"patch":17,"prerelease":["candidate"],"build":[],"version":"2.7.17-candidate"},"sysPrefix":"/usr","fileHash":"cea21c90ece13b7d57ea230cc4797498be40322864666b0376daa4b16fffe3a18e6d9b18acc4c9bb0b38891be6fcc80863ac6873bc68fc1c3dccb6f03244a024","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python2","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-candidate","major":2,"minor":7,"patch":17,"prerelease":["candidate"],"build":[],"version":"2.7.17-candidate"},"sysPrefix":"/usr","fileHash":"d930d62ae84ecfdbccfbdae2e63c7fb7746f0d13df490406bbfe33ba658c92b522b9b7c0b06e1075dd1fbbb2c649add422ea8001ef6532709af32b8fb0d1096c","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-candidate","major":2,"minor":7,"patch":17,"prerelease":["candidate"],"build":[],"version":"2.7.17-candidate"},"sysPrefix":"/usr","fileHash":"dcad016575e7128591e25deadde8a3512d2df3dd31a28be4f3495e997b790f7c337a150f1012555dbbdac4e29ecd1edbb7434d7c4744e4a7acd37237adb8860a","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.5-candidate","major":3,"minor":7,"patch":5,"prerelease":["candidate"],"build":[],"version":"3.7.5-candidate"},"sysPrefix":"/usr","fileHash":"81837b4bbb8c24bc13bac839d40b4530029c321b72ba03034056024debf81751d342ce9ac2d2d042dd682ac424e9829716d19220dad8b47a3768b8aa0bf388ba","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python3.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.5-candidate","major":3,"minor":7,"patch":5,"prerelease":["candidate"],"build":[],"version":"3.7.5-candidate"},"sysPrefix":"/usr","fileHash":"436798a1cb146b9c6dbe068a8ac34b9b18f7ef2cceb7c8d9f113796b7734479d697cb8ef9a5d76a6bb989dd69fa39b5e6c8eeb8e8cf193daa0080d21ab183493","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python3.8","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.8.0-final","major":3,"minor":8,"patch":0,"prerelease":["final"],"build":[],"version":"3.8.0-final"},"sysPrefix":"/usr","fileHash":"0e235cfca94940a1f939f161220a7d71b982f13c6a801d091faad7c949f71ec68e22d1dfe079049cdea331099606c28fb448b67b095e038623efacd735ab864b","type":"Unknown"},{"architecture":3,"path":"/usr/local/bin/python3.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/usr/local","fileHash":"58fa080cefcf174f0e9c09ec206bead030f8bc3d33ede1ae426c452221d009fed73efc28e15296c6e8a46016e65273adfd8a25520d05b4423ceb5f3e2bbb7ae9","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-candidate","major":2,"minor":7,"patch":17,"prerelease":["candidate"],"build":[],"version":"2.7.17-candidate"},"sysPrefix":"/usr","fileHash":"cea21c90ece13b7d57ea230cc4797498be40322864666b0376daa4b16fffe3a18e6d9b18acc4c9bb0b38891be6fcc80863ac6873bc68fc1c3dccb6f03244a024","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python2","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-candidate","major":2,"minor":7,"patch":17,"prerelease":["candidate"],"build":[],"version":"2.7.17-candidate"},"sysPrefix":"/usr","fileHash":"d930d62ae84ecfdbccfbdae2e63c7fb7746f0d13df490406bbfe33ba658c92b522b9b7c0b06e1075dd1fbbb2c649add422ea8001ef6532709af32b8fb0d1096c","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-candidate","major":2,"minor":7,"patch":17,"prerelease":["candidate"],"build":[],"version":"2.7.17-candidate"},"sysPrefix":"/usr","fileHash":"dcad016575e7128591e25deadde8a3512d2df3dd31a28be4f3495e997b790f7c337a150f1012555dbbdac4e29ecd1edbb7434d7c4744e4a7acd37237adb8860a","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.5-candidate","major":3,"minor":7,"patch":5,"prerelease":["candidate"],"build":[],"version":"3.7.5-candidate"},"sysPrefix":"/usr","fileHash":"81837b4bbb8c24bc13bac839d40b4530029c321b72ba03034056024debf81751d342ce9ac2d2d042dd682ac424e9829716d19220dad8b47a3768b8aa0bf388ba","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python3.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.5-candidate","major":3,"minor":7,"patch":5,"prerelease":["candidate"],"build":[],"version":"3.7.5-candidate"},"sysPrefix":"/usr","fileHash":"436798a1cb146b9c6dbe068a8ac34b9b18f7ef2cceb7c8d9f113796b7734479d697cb8ef9a5d76a6bb989dd69fa39b5e6c8eeb8e8cf193daa0080d21ab183493","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python3.8","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.8.0-final","major":3,"minor":8,"patch":0,"prerelease":["final"],"build":[],"version":"3.8.0-final"},"sysPrefix":"/usr","fileHash":"0e235cfca94940a1f939f161220a7d71b982f13c6a801d091faad7c949f71ec68e22d1dfe079049cdea331099606c28fb448b67b095e038623efacd735ab864b","type":"Unknown"}]
Info Python Extension: 2019-11-04 15:27:03: Get Interpreters in CacheableLocatorService, Class name = m, completed in 3ms, Arg 1: <Uri:/home/shenghang/code/eazybi-jira-connector>, Return Value: [{"architecture":3,"path":"/home/shenghang/.pyenv/versions/3.7.3/bin/python3.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.7.3","fileHash":"c4b884b81e5324207c811c4bd013032a4c9ead5b3212a5cf5507d293eefb233918585c12da4c6286cabe7b3b295bb868ead17f0c91fd81cbc6c40c082fe5aec3","type":"Unknown"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/3.7.3/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.7.3","fileHash":"2414cdbe39641f56d09759395984b124be5831ee05931962264d6bdb043a069aabddf05d870e60ab3de8459046d18d02ecfe103459abd166f135f8bc5214c4c8","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python2","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-candidate","major":2,"minor":7,"patch":17,"prerelease":["candidate"],"build":[],"version":"2.7.17-candidate"},"sysPrefix":"/usr","fileHash":"d930d62ae84ecfdbccfbdae2e63c7fb7746f0d13df490406bbfe33ba658c92b522b9b7c0b06e1075dd1fbbb2c649add422ea8001ef6532709af32b8fb0d1096c","type":"Unknown"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/3.7.3/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.7.3","fileHash":"b86fc7970bb16ce62d316bf8d5030752c77bf6ff34dc7bd98038105a4e2bc45b722bda996bd50825223e4961bdfc3b2757fdc268a83ef3ccffbbac32cbba9b0e","type":"Unknown"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/3.7.3/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.7.3","fileHash":"b86fc7970bb16ce62d316bf8d5030752c77bf6ff34dc7bd98038105a4e2bc45b722bda996bd50825223e4961bdfc3b2757fdc268a83ef3ccffbbac32cbba9b0e","type":"Unknown"}]
Info Python Extension: 2019-11-04 15:27:03: Get Interpreters, Class name = g, completed in 6ms, Arg 1: <Uri:/home/shenghang/code/eazybi-jira-connector>, Return Value: [{"architecture":3,"path":"/home/shenghang/.virtualenvs/jama-export-import-tool-_YLULkJE/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.virtualenvs/jama-export-import-tool-_YLULkJE","fileHash":"801aecc5bc0ac396450874d6a2618e725b225943dcd1991e7565ae7e184c73c1ea8ad76915df67d4959b35d9b81a19b663c8d669d285b7b4b73f752db7a286ad","envName":"jama-export-import-tool-_YLULkJE","type":"VirtualEnv"},{"architecture":3,"path":"/home/shenghang/.virtualenvs/py-jama-rest-client-v9zcyaOA/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.virtualenvs/py-jama-rest-client-v9zcyaOA","fileHash":"bf9fe6e663bd6167746c037dfb451146a4de3d1dcc969fc6c1bb9141c99dabed54aa5918808277119114cb72939eadde5480ea8d549b727510315422f731b7bb","envName":"py-jama-rest-client-v9zcyaOA","type":"VirtualEnv"},{"architecture":3,"path":"/home/shenghang/.virtualenvs/python-nvconnect-Oacfg-Or/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.15-candidate","major":2,"minor":7,"patch":15,"prerelease":["candidate"],"build":[],"version":"2.7.15-candidate"},"sysPrefix":"/home/shenghang/.virtualenvs/python-nvconnect-Oacfg-Or","fileHash":"ca43f294ba471e755add5a556ea3b51a7b2a76cf0edfc146d5c5d1107a78326b13fa614d84588759bdc71186036ba3f5853714d36aec734009ea5d5a9709ac85","envName":"python-nvconnect-Oacfg-Or","type":"VirtualEnv"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/2.7/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.0-final","major":2,"minor":7,"patch":0,"prerelease":["final"],"build":[],"version":"2.7.0-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/2.7","fileHash":"4c28b6da2e8af0551a5a2138de91aaa6bc3b13f233e03a4119b397b7c5c84864bfec00ce33a45d158e8668632b6ac5e9bc0d6dbc9a7037a8ec222681fa3fbd6d","envName":"2.7","type":"Pyenv"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/3.7.3/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.7.3","fileHash":"b86fc7970bb16ce62d316bf8d5030752c77bf6ff34dc7bd98038105a4e2bc45b722bda996bd50825223e4961bdfc3b2757fdc268a83ef3ccffbbac32cbba9b0e","envName":"3.7.3","type":"Pyenv"},{"architecture":3,"path":"/home/shenghang/.pyenv/versions/3.8.0/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.8.0-final","major":3,"minor":8,"patch":0,"prerelease":["final"],"build":[],"version":"3.8.0-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.8.0","fileHash":"76f805ffe5322ff60dc66572f08d2ce0f489b41c4580e542a7df39f2bc3307dfaeb897cc7b318e9ef95b682303a524dde266750c1d612e3f1ba6be4f246ee87a","envName":"3.8.0","type":"Pyenv"},{"architecture":3,"path":"/home/shenghang/.pyenv/shims/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/home/shenghang/.pyenv/versions/3.7.3","fileHash":"9918974580d7464e82595565f6ba1f08c2174d332a61f5f134080bde0a7295c09e68f51d065aa67a1aab113ea61e2cbfd89f93cb86d11284d24ccb3ab66a28cf","type":"Unknown"},{"architecture":3,"path":"/home/shenghang/.pyenv/shims/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-candidate","major":2,"minor":7,"patch":17,"prerelease":["candidate"],"build":[],"version":"2.7.17-candidate"},"sysPrefix":"/usr","fileHash":"199b9a85de8b2904a2e4c95ad4aa5e185b17d06bc0b6e0fdf8b859df64a299ba1e047fafb924e6d5dd550830c7404d2132a5b68b3f48148af80a478fc7378cea","type":"Unknown"},{"architecture":3,"path":"/home/shenghang/.pyenv/shims/python3.8","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.8.0-final","major":3,"minor":8,"patch":0,"prerelease":["final"],"build":[],"version":"3.8.0-final"},"sysPrefix":"/usr","fileHash":"e456d6ee14622ce284dcbe81c3bdf40e802415c5b22a171c84016b85b926ed94ebff6cbaa609c0b7120483579f689f50a40f88d6f97500ace23ca8603de677f2","type":"Unknown"},{"architecture":3,"path":"/usr/local/bin/python3.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/usr/local","fileHash":"58fa080cefcf174f0e9c09ec206bead030f8bc3d33ede1ae426c452221d009fed73efc28e15296c6e8a46016e65273adfd8a25520d05b4423ceb5f3e2bbb7ae9","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-candidate","major":2,"minor":7,"patch":17,"prerelease":["candidate"],"build":[],"version":"2.7.17-candidate"},"sysPrefix":"/usr","fileHash":"cea21c90ece13b7d57ea230cc4797498be40322864666b0376daa4b16fffe3a18e6d9b18acc4c9bb0b38891be6fcc80863ac6873bc68fc1c3dccb6f03244a024","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.5-candidate","major":3,"minor":7,"patch":5,"prerelease":["candidate"],"build":[],"version":"3.7.5-candidate"},"sysPrefix":"/usr","fileHash":"81837b4bbb8c24bc13bac839d40b4530029c321b72ba03034056024debf81751d342ce9ac2d2d042dd682ac424e9829716d19220dad8b47a3768b8aa0bf388ba","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python3.8","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.8.0-final","major":3,"minor":8,"patch":0,"prerelease":["final"],"build":[],"version":"3.8.0-final"},"sysPrefix":"/usr","fileHash":"0e235cfca94940a1f939f161220a7d71b982f13c6a801d091faad7c949f71ec68e22d1dfe079049cdea331099606c28fb448b67b095e038623efacd735ab864b","type":"Unknown"}]

Where the virtualenvs folder: ls ~/.cache/pypoetry/virtualenvs -l

drwxr-xr-x 5 shenghang shenghang 4096 Jul 31 14:34 commit-validation-py3.7
drwxr-xr-x 6 shenghang shenghang 4096 Nov  4 14:09 eazybi-jira-connector-b7g26Unn-py3.7
-rw-r--r-- 1 shenghang shenghang   64 Oct 23 14:52 envs.toml
drwxr-xr-x 7 shenghang shenghang 4096 Aug 16 14:42 gerrit-validator-py3.7
@wy193777 wy193777 added triage-needed Needs assignment to the proper sub-team bug labels Nov 4, 2019
@brettcannon brettcannon added area-environments Features relating to handling interpreter environments needs decision labels Nov 5, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Nov 5, 2019
@brettcannon brettcannon changed the title Cannot find poetry virtual envs. Support poetry virtual environments Nov 5, 2019
@brettcannon
Copy link
Member

brettcannon commented Nov 5, 2019

We actually don't support poetry environments automatically (see environment docs on where we do look). When we added support for installing dev dependencies via poetry the environment support wasn't working. I have turned this issue into a feature request to see if people 👍 the original comment to help us decide work priorities.

I will also say that you can work around this by setting "python.venvPath": "~/.cache/pypoetry/virtualenvs".

@wy193777
Copy link
Author

wy193777 commented Nov 6, 2019

This issue is about even I did "python.venvPath": "~/.cache/pypoetry/virtualenvs", VS Code still cannot find virtual env in ~/.cache/pypoetry/virtualenvs folder.

@wy193777
Copy link
Author

wy193777 commented Nov 6, 2019

Oh, I find that only add the setting in setting.json works.

@kwint
Copy link

kwint commented Nov 21, 2019

For me, adding ~/.cache/pypoetry/virtualenvs to the python venv Path setting via the GUI worked.

@rvanlaar
Copy link

rvanlaar commented Dec 11, 2019

@kwint @wy193777 could you elaborate on where you set that variable?
I tried setting it in user, workspace and folder settings. I didn't made a difference.

Are you using pyenv with it?

@rvanlaar
Copy link

rvanlaar commented Dec 11, 2019

What fixed it for me was to manually specifiy in the .vscode/settings: "python.pythonPath": "~/.cache/pypoetry/virtualenvs/app-sNwkCRg1-py3.6"

@kwint
Copy link

kwint commented Dec 11, 2019

It was the python Venv Path for me

@brettcannon
Copy link
Member

brettcannon commented Dec 11, 2019

Correct, you can set "python.venvPath" to capture all Poetry virtual environments.

@rvanlaar
Copy link

rvanlaar commented Dec 12, 2019

Setting "python.venvPath" doesn't do anything for me. It keeps showing my pipenv and pyenv installs.

@ViRb3
Copy link

ViRb3 commented Dec 15, 2019

Poetry 1.0.0 (stable) has been released!
https://github.com/python-poetry/poetry/releases/tag/1.0.0

@davegallant
Copy link

davegallant commented Jan 5, 2020

Simple python script if you want to set it and forget it (requires poetry >= 1):

#!/usr/bin/env python3

import json
import subprocess
from pathlib import Path

venv_path = subprocess.check_output("poetry env info --path".split())
venv_path = venv_path.decode("UTF-8")

settings = dict()

Path(".vscode").mkdir(parents=True, exist_ok=True)
Path(".vscode/settings.json").touch()


with open(".vscode/settings.json", "r") as f:
    settings = json.load(f)
    settings["python.pythonPath"] = venv_path

with open(".vscode/settings.json", "w") as f:
    json.dump(settings, f, sort_keys=True, indent=4)


print(json.dumps(settings, sort_keys=True, indent=4))

@zachvalenta
Copy link

zachvalenta commented Jan 29, 2020

We actually don't support poetry environments automatically (see environment docs on where we do look). When we added support for installing dev dependencies via poetry the environment support wasn't working. I have turned this issue into a feature request to see if people 👍 the original comment to help us decide work priorities.

I will also say that you can work around this by setting "python.venvPath": "~/.cache/pypoetry/virtualenvs".

I don't know if it's a version thing (I'm on Poetry 1.0.0 and macOS 10.14) but Poetry virtualenvs are stored at ~/Library/Caches/pypoetry/virtualenvs/, not in the ~/.cache/pypoetry/virtualenvs directory.

@karrtikr
Copy link

karrtikr commented Apr 9, 2021

Hi everyone, we now support Poetry in the Insiders build of the extension. You can use the command Python: Switch to Insiders Weekly Channel to install the latest Insiders build. Do give it a try and let us know how it works for you 🙂

You can also download and install latest insiders build from here https://pvsc.blob.core.windows.net/extension-builds/ms-python-insiders.vsix.

@aaronsteers
Copy link

aaronsteers commented Apr 9, 2021

@karrtikr - This is awesome - thank you! On loading the Python Extention's Insiders build, I immediately found the option to use the poetry's python interpreter. 🎉 From what I can tell, tests and libraries are all working correctly now with Poetry. Do we need to modify any other paths in settings.json (linters, pytest, venv paths, etc.), or is this the only step?

@donbowman
Copy link

donbowman commented Apr 9, 2021

Cannot activate the 'Python' extension because it depends on an unknown 'ms-toolsai.jupyter' extension.

was my result.
I tried pip3 install -U ms-toolsai.jupyter but it could not find.

ubuntu 21.10, python 3.9.4-1 from dist.

@karrtikr
Copy link

karrtikr commented Apr 9, 2021

@aaronsteers Awesome. Nope, you do not need to configure anything. We'll roll this out in the stable marketplace build soon.

@donbowman You'll need to install Jupyter extension from the VSCode marketplace. Click the marketplace icon and search for 'ms-toolsai.jupyter'. Currently both the extensions need to be installed for either one to work.

@donbowman
Copy link

donbowman commented Apr 10, 2021

that extension is only available on the 'insiders' build of vscode as well. so its not just putting the python one to 'insiders', its changing the whole thing. Is there a reason they need to be tied together? I don't use jupyter.

I'll try to find a time to change the environment over to try.

@brettcannon
Copy link
Member

brettcannon commented Apr 12, 2021

@donbowman they are tied together because the Jupyter extension was spun out of this extension in November and we haven't fully decoupled them yet. We are actively working towards breaking the dependency, but we are obviously not there yet.

@aaronsteers
Copy link

aaronsteers commented Apr 12, 2021

@karrtikr - So far, this has been a fantastic experience. I have one piece of feedback I wanted to share here. (Lmk if I should log elsewhere.)

I can see that now all of my terminal windows are starting automatically in the poetry virtual environment, which is awesome. However, when I try using pipx to install components which should be installed separate from my poetry venv, I found that instead it was attempting to install directly into poetry, and then failing due to version conflicts and/or missing packages. This might be a bug in pipx or it might have a workaround with pipx cli args, but I wanted to see if you have any thoughts on this.

Two things I thought might be helpful:

(1) After sending the source command for the virtualenv, echo something during the shell init that tells the user how to exit the venv. It looks like deactivate works but it took me a while to discover that.
(2) Now that very shell profiles are very easy to instantiate without having to switch your default, it might be handy to pre-populate a poetry and non-poetry version of the shell (probably still defaulting to the poetry version as you've done).

Thanks again!

@aaronsteers
Copy link

aaronsteers commented Apr 12, 2021

@donbowman - FWIW, I'm not on the Insider build of VS Code but I was still able to install the insider version of this plugin. I already had Jupyter plugin installed though, probably from a while back.

I'm on VS Code Version: 1.55.1 and Mac OS Darwin x64 20.3.0

@brettcannon
Copy link
Member

brettcannon commented Apr 13, 2021

@aaronsteers thanks for the feedback!

when I try using pipx to install components which should be installed separate from my poetry venv, I found that instead it was attempting to install directly into poetry, and then failing due to version conflicts and/or missing packages.

Not sure as pipx is supposed to install entirely new virtual environments, so I would think either pipx expects to not be in a virtual environment or it's a bug for them.

After sending the source command for the virtualenv, echo something during the shell init that tells the user how to exit the venv. It looks like deactivate works but it took me a while to discover that.

There's two issues with that. One, this would inevitably break people's code (we already have issues with race conditions doing the activation, so tossing in an echo or something to print the instructions isn't going to help 😉). Two, I don't know if we want to get into the teaching area for this sort of thing. Not wanting an activated environment versus not is already somewhat of an advanced topic (heck, environments period seem to be a generally unknown thing for folks). So I suspect we would prefer to err on the side of simple (plus people typically want the activation more than not wanting it).

Now that very shell profiles are very easy to instantiate without having to switch your default, it might be handy to pre-populate a poetry and non-poetry version of the shell (probably still defaulting to the poetry version as you've done).

Once again, this is bit advanced for a lot of folks.

Regardless of my feedback, if you would like us to consider these feature requests then please open discussions at https://github.com/microsoft/vscode-python/discussions/categories/ideas, otherwise we are bound to lose track of them.

@aaronsteers
Copy link

aaronsteers commented Apr 13, 2021

@brettcannon - Thanks for hearing my feedback and for your thoughtful response. Those points you raised make a lot of sense, I think. I think you've made a good case for not changing the core functionality.

If there's some type of documentation that the Python extension also is auto-activating the poetry environment in all shells (in addition to the native python-based stuff like tests), that could be helpful. This could be a new section in the docs, or just a quick blurb here or here. I do think overriding the shell behavior is awesome - and also probably a big enough change to default VS Code behavior that it would be good to have clearly documented.

Thanks!

@brettcannon
Copy link
Member

brettcannon commented Apr 13, 2021

@aaronsteers automatic activation is documented at https://code.visualstudio.com/docs/python/environments#_select-and-activate-an-environment. If you think there's something to clarify there then that can be opened at https://github.com/microsoft/vscode-docs.

@farhansaed
Copy link

farhansaed commented May 2, 2021

This is what worked for me. after creating the virtual environment with poetry it was not been detected by vscode in python interpreter selection (shift+cmd+p) even after restart.
macOS Big Sur 11.2.3

  1. First add "python.venvPath": "~/Library/Caches/pypoetry/virtualenvs", into workspace settings.
  2. Then restart vscode this will make your virtual environment appear in python interpreter selection(shift+cmd+p).
  3. Select your interpreter related to our virtual environment and this will make an automatic entry in settings.json in workspace. Restart vscode.
  4. Your virtual environment based interpreter will be detected and appear in bottom blue bar (status bar).

However the problem is virtual environment doesn't get activated automatically as it does for pipenv as vscode everytime vscode is closed and restarted again.

@TBBle
Copy link

TBBle commented May 2, 2021

However the problem is virtual environment doesn't get activated automatically as it does for pipenv as vscode everytime vscode is closed and restarted again.

That's because your solution is bypassing the Poetry support in VSCode (which handles activating the active Poetry env), and is just using the "search a directory for virtual envs" support that already existed in the plugin. See #8372 (comment)

@aaronsteers
Copy link

aaronsteers commented May 6, 2021

To the maintainers - do you have a general eta for when you expect this to GA? Not intending to rush it but curious if this is expected in the coming month or further out. Thanks!

@brettcannon
Copy link
Member

brettcannon commented May 7, 2021

@aaronsteers current plan is next week with our 2021.5 release.

@luabud
Copy link
Member

luabud commented May 12, 2021

Poetry support is now available on version 2021.5!

@luabud luabud closed this as completed May 12, 2021
@cailloumajor
Copy link

cailloumajor commented May 14, 2021

This doesn't appear in the changelog for version 2021.5 !

@farhansaed
Copy link

farhansaed commented May 14, 2021

My virtual env creation doesn't get triggered automatically as soon I cd into the directory containing toml file. Whereas this happens for pipenv.

@karrtikr
Copy link

karrtikr commented May 14, 2021

@farhan3sixty1 Can you please create a new issue filling the issue template. I'm unclear on the problem you're referring to.

@cailloumajor Yes, actually it was already available for 20% of users before (when we added it in the changelog), we just rolled it out to everybody.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-environments Features relating to handling interpreter environments feature-request
Projects
None yet
Development

No branches or pull requests