question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: autoupdate of python.autoComplete.extraPaths for virtualenv/pyenv

See original GitHub issue

Environment data

VS Code version: 1.18.1 Python Extension version: 0.8.0 Python Version: 3.6.3 and 2.7.14 OS and version: windows10 with wsl, and linux Ubuntu 16.04LTS

In settings I add the following manually (this is win10 vsc with wsl under lxss):

 "python.autoComplete.extraPaths": [
        //"C:\\dist\\Python36\\Lib",
        //"C:\\dist\\Python36\\Lib\\site-packages",
        //"C:\\dist\\Python27\\Lib\\site-packages",
        "C:\\Users\\morten.sensio\\AppData\\Local\\lxss\\home\\mortenb\\.pyenv\\versions\\3.6.3\\envs\\xmpp\\lib\\python3.6\\site-packages",
        "C:\\Users\\morten.sensio\\AppData\\Local\\lxss\\home\\mortenb\\.pyenv\\versions\\3.6.3\\envs\\xmpp\\lib64\\python3.6\\site-packages",
        //"C:\\Users\\morten.sensio\\AppData\\Local\\lxss\\home\\mortenb\\.pyenv\\versions\\3.6.3\\envs\\unity\\lib\\python3.6\\site-packages",
        //"C:\\Users\\morten.sensio\\AppData\\Local\\lxss\\home\\mortenb\\.pyenv\\versions\\3.6.3\\envs\\unity\\lib64\\python3.6\\site-packages",
    ],

This is just 2 project, I have legacy 2.7.x projects also, so this file is becomming very large, and I like to uncomment those that are not active

Is there a way to do this automatic based on some scripts, enverionment variables etc. I uses pyenv/virtualenv everywhere. In production we just install and replace the shebang, it then knows where all packages resides, no need to configure anything

aka: #!/home/restuser/.pyenv/versions/3.6.3/envs/flask/bin/python3 This finds all packages etc under this domain. very easy and very simple to maintain.

Is this possible to autosense this in any way so it becomes active after I do a pyenv activate unity (linux) or virtualenv ./unity; ./unity/scripts/activate.ps1 (win) before I start vsc?

Thanks for an excellent free editor 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
brettcannoncommented, Apr 10, 2018

Is this still an issue? I’m understanding why the appropriate paths for your virtual environment when you have it set are not picking up the installed packages.

0reactions
brettcannoncommented, Jun 5, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

autoupdate of python.autoComplete.extraPaths for virtualenv ...
This finds all packages etc under this domain. very easy and very simple to maintain. Is this possible to autosense this in any...
Read more >
Use virtualenv with Python with Visual Studio Code
The values for "python.autoComplete.extraPaths" will be determined during runtime, but you are still free to specify custom paths in there.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found