0

I tried to set up PYTHONPATH environmental variable in vscode in Mac, and it does not work. VScode version: Version: 1.78.1 (Universal), Mac os: 13.3.1 (a) I followed the instruction: https://code.visualstudio.com/docs/python/environments#_use-of-the-pythonpath-variable In workspace setting.json

{
    "workbench.colorCustomizations": {
        "editorLineNumber.foreground": "#00ff00"
    },
    "terminal.integrated.env.osx": {
        "PYTHONPATH": "${workspaceFolder}/src",
        "ABC": "124"
    }
}

In the terminal, I type

echo $PYTHONPATH

and it returns:

/usr/local/Cellar/apache-spark/3.3.2/libexec/python/

I then set PYTHONPATH in user settint.json like this

{
    "terminal.integrated.defaultProfile.osx": "bash",
    "terminal.integrated.inheritEnv": false,
    "terminal.integrated.env.osx": {
        "PYTHONPATH": "${workspaceFolder}/src"
    }
}

I closed vs code and reopened, and type

echo $PYTHONPATH

and got same result.

I also set PYTHONPATH in .env right under workspace

PYTHONPATH=/Users/{user_name}/gitlab/aws/dummy_project

it does not work either.

Can anyone help on this?

2 Answers 2

1

I found I define

export PYTHONPATH={some value}

in .bash_profile. After I commenting this line, setting in terminal.integrated.env.osx works.

Sign up to request clarification or add additional context in comments.

Comments

0

steps to configure the python path in vscode: enter image description here

enter image description here

Then add python.exe path enter image description here

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.