0

I got an annoying issue triggered my obsession.

I am using vscode on Mac. I have a python conda env and I am normally using it.

For one vscode window, when I do the log check through 'Output' button, it looks good:

Experiment 'pythonaa' is active
Experiment 'pythonTensorboardExperiment' is active
Experiment 'pythonSurveyNotification' is active
Experiment 'PythonPyTorchProfiler' is active
Experiment 'pythonDeprecatePythonPath' is active
> conda info --json
> ~/anaconda3/envs/gnn/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1786462952/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1786462952/pythonFiles/interpreterInfo.py
> ~/anaconda3/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1786462952/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1786462952/pythonFiles/interpreterInfo.py
> ~/anaconda3/envs/crawler/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1786462952/pythonFiles/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2022.0.1786462952/pythonFiles/interpreterInfo.py
Python interpreter path: ~/anaconda3/envs/gnn/bin/python
> . ~/anaconda3/bin/activate && conda activate gnn && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2022.0.1786462952/pythonFiles/printEnvVariables.py
Starting Pylance language server.
> ~/anaconda3/envs/gnn/bin/python ~/.vscode/extensions/ms-python.python-2022.0.1786462952/pythonFiles/linter.py -m pylint ./greedy.py
cwd: .

but when I opened the other windows, I got

ERROR 2022-1-6 15:57:27.538]: getActivatedEnvironmentVariables [SyntaxError: Invalid regular expression: //[mypath]: Nothing to repeat
    at new RegExp (<anonymous>)
    at h ([mypath]/.vscode/extensions/ms-python.python-2022.0.1786462952/out/client/extension.js:104:312461)
    at d.getDisplayCommands ([mypath]/.vscode/extensions/ms-python.python-2022.0.1786462952/out/client/extension.js:104:312240)
    at d.logProcess ([mypath]/.vscode/extensions/ms-python.python-2022.0.1786462952/out/client/extension.js:104:311978)
    at s.emit (events.js:315:20)
    at shellExec ([mypath]/.vscode/extensions/ms-python.python-2022.0.1786462952/out/client/extension.js:52:33373)
    at P.getActivatedEnvironmentVariablesImpl ([mypath]/.vscode/extensions/ms-python.python-2022.0.1786462952/out/client/extension.js:85:118653)]
Starting Pylance language server.

Linter 'pylint' is not installed. Please install it or select another linter".
SyntaxError: Invalid regular expression: //[mypath]: Nothing to repeat

I use [mypath] to alternate my local path.

Please enlighten me how to solve it. I am sure my conda env is rightly linked to my vscode.

Edee
  • 1,746
  • 2
  • 6
  • 14

1 Answers1

0

Similar question: Error message "Linter pylint is not installed"

You need to activate the conda environment manually on the second one if not triggered automatically.

Check this conda guide to get more clarity on such environments: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

Abdullah Khilji
  • 370
  • 2
  • 8
  • When I open my VScode, the env is automatically activated. It just failed for some reason. – Edee Feb 06 '22 at 07:48
  • Did you try installing `pylint` to both your base and new enviroment: `conda install pylint` – Abdullah Khilji Feb 06 '22 at 07:50
  • I don't think the issue is on my pylint, because I got one window working normally, I chose the same interpreter, same settings, same working&user env. – Edee Feb 06 '22 at 07:54
  • But the conda on this window, just doesn't normally triggered. – Edee Feb 06 '22 at 07:54
  • It seems you are facing a similar issue as given here: https://stackoverflow.com/questions/43272664/error-message-linter-pylint-is-not-installed – Abdullah Khilji Feb 06 '22 at 07:56
  • I understand what you are trying to say. But I think the issue is on getActivatedEnvironmentVariables [SyntaxError: Invalid regular expression: //[mypath]: Nothing to repeat – Edee Feb 06 '22 at 08:05
  • There are //, this double slash seems like Windows path style. – Edee Feb 06 '22 at 08:06
  • My setting.json can not even work. I change "python.linting.pylintPath": to my path, but it also doesn;t work, same log. – Edee Feb 06 '22 at 08:09
  • Did you determine your path to `pylint` using `which pylint`? Also please update the same in settings and restart your VS code applicaiton. – Abdullah Khilji Feb 06 '22 at 08:12
  • sure, that's what Ive done – Edee Feb 06 '22 at 08:14
  • Try the other solutions here: https://stackoverflow.com/questions/43272664/error-message-linter-pylint-is-not-installed hope that helps – Abdullah Khilji Feb 06 '22 at 08:16