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.

python.venvPath config setting does not expand variables

See original GitHub issue

I’m migrating from coc-python, and I have this in my global config file

  "python.venvPath":"~/.virtualenvs",

Previously this worked, but now I see the following message in the pyright output:

[Error  - 12:17:32] venvPath /home/ash/code/airflow/airflow/~/.virtualenvs is not a valid directory.

I also tried with $HOME, neither worked.

Please could one of these expansion mechanisms work before the config is passed on to pyright?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
ashbcommented, Apr 26, 2021

@g6ai This is what I have in my global coc-settings.json

  "python.venvPath":"${env:HOME}/.virtualenvs",

Probably no space after the :

2reactions
ashbcommented, Apr 27, 2021

For anyone coming across this issue, the fix is (or will be when next pyright release happens) is to use ${env:HOME}

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I add a path to PYTHONPATH in virtualenv
I tried SET PYTHONPATH=... under a virtualenv command prompt, but that sets the variable for the whole environment. How do I achieve that?...
Read more >
venv — Creation of virtual environments — Python 3.11.1 ...
When a virtual environment has been activated, the VIRTUAL_ENV environment variable is set to the path of the environment. Since explicitly activating a...
Read more >
VS Code does not expand variables in its settings - Super User
My example: I need to configure Remote.SSH: Config File to point to a file relative to my home directory. Verbatim values work: C:/Users/ ......
Read more >
Settings Reference for Python - Visual Studio Code
This page describes the key settings you can work with. For general information about working with settings in VS Code, refer to User...
Read more >
Configuration | Documentation | Poetry - Python dependency ...
Configuration Poetry can be configured via the config command (see more ... to use environment variables and not have to execute configuration commands....
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