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

Install Command Line Developer Tools -pop up keeps appearing #20446

Closed
HenriManninen opened this issue Jan 1, 2023 · 11 comments
Closed

Install Command Line Developer Tools -pop up keeps appearing #20446

HenriManninen opened this issue Jan 1, 2023 · 11 comments
Assignees
Labels
area-environments Features relating to handling interpreter environments triage-needed Needs assignment to the proper sub-team

Comments

@HenriManninen
Copy link

Type: Bug

I'm running MacOS 12.6.2 on a 2021 MacBook Pro. The Python extension version is v2022.20.1.

Steps to reproduce (installing Python and VS Code on a new system):

  1. Download the latest version of Python for Mac from Python website.
  2. Run the installation. It should work normally.
  3. Download Visual Studio Code from the official website.
  4. Install it. Should install normally.
  5. Open VS Code. Create new Python file (or open an existing Python file).
  6. Try to run the file. The program requires to install a Python extension.
  7. Install the recommended extension.
  8. An "Install Command Line Developer Tools" pop up appears stating 'The "python3" command requires the command line developer tools. Would you like to install the tools now?' I haven't tried to install these, as it shouldn't be necessary.

The pop up appears every time the VS Code is launched and sometimes seemingly irregularly while the app is running. It is worth noting, that the pop up doesn't appear when the Python extension is not installed. Also, it doesn't appear when using other IDE, like PyCharm. Otherwise Python seems to be working on the computer and even on VS Code.

Screenshot of the pop up (in Finnish)
Näyttökuva 2022-1-1 kello 9 54 56

Extension version: 2022.20.1
VS Code version: Code 1.74.2 (Universal) (e8a3071ea4344d9d48ef8a4df2c097372b0c5161, 2022-12-20T10:26:09.430Z)
OS version: Darwin arm64 21.6.0
Modes:
Sandboxed: No

System Info
Item Value
CPUs Apple M1 Pro (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 2, 4, 3
Memory (System) 16.00GB (0.09GB free)
Process Argv --crash-reporter-id 77c5d171-a0da-47b5-a64e-5093a204dd79
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vscaac:30438847
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
azure-dev_surveyone:30548225
vsccc:30610678
pyindex848cf:30577861
nodejswelcome1:30587005
2e4cg342:30602488
iaj6b796:30613358
89544117:30613380
fim-prod:30623723

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 1, 2023
@HenriManninen HenriManninen changed the title Install Command Line Developer Tools -pop up appears Install Command Line Developer Tools -pop up keeps appearing Jan 1, 2023
@maurosilber
Copy link

I have a similar issue, with the "install developer tools" pop-up appearing the first time I open a Python file or Jupyter notebook:
image

I have installed Python through mambaforge (the miniconda variant from conda-forge),
and tried adding the base environment's path to the PATH variable in:

  • ~/.zshrc
  • ~/.zprofile
  • /etc/paths

among other tests.

A "placeholder" python3 binary exists in /usr/bin/python3, which triggers the "install developers tools" message.
May this be due to a hardcoded path to that file, instead of looking for python3 in PATH?
That path appears to be hardcoded in al least 5 files in the codebase: https://github.com/microsoft/vscode-python/search?q=%2Fusr%2Fbin%2Fpython3

@karrtikr
Copy link

karrtikr commented Jan 4, 2023

Can you please provide the logs? Set python.logging.level to debug in User settings, reload window, then perform the steps to reproduce before providing the logs.

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

@karrtikr karrtikr added info-needed Issue requires more information from poster area-environments Features relating to handling interpreter environments labels Jan 4, 2023
@HenriManninen
Copy link
Author

I hope I followed the steps correctly. After following them I restarted VS Code and some logs were printed in the output.

Here is the Python output right after opening VS Code again:

Python_output_after_opening.pdf

@karrtikr karrtikr removed the info-needed Issue requires more information from poster label Jan 5, 2023
@karrtikr
Copy link

karrtikr commented Feb 2, 2023

Thanks. I think it's because running /usr/bin/python3 directly requires this option. Try running it in a terminal outside VSCode, I suspect you'll still that issue. Unfortunately the extension cannot do anything here, as this is due to faulty python itself.

Also, it doesn't appear when using other IDE, like PyCharm.

It's likely using some other python to run your files.

@karrtikr
Copy link

karrtikr commented Feb 2, 2023

sometimes seemingly irregularly while the app is running

Once microsoft/vscode-jupyter#12719 is taken care of, this should stop happening automatically.

Please choose a different interpreter via Python: Select Interpreter command to avoid this issue.

@karrtikr karrtikr added the info-needed Issue requires more information from poster label Feb 2, 2023
@HenriManninen
Copy link
Author

Thanks for the reply. I tried running Python in the terminal and it works fine (no pop-ups appear).

Näyttökuva 2023-2-4 kello 11 15 30

Also, I checked that PyCharm should be using the same interpreter (Python 3.11 /usr/local/bin/python3.11).

@karrtikr
Copy link

karrtikr commented Feb 4, 2023

Try running using the full path: /usr/bin/python3.

@HenriManninen
Copy link
Author

Ok, that brings up the pop-up. So what might be the issue here?

Näyttökuva 2023-2-4 kello 11 39 29

@karrtikr karrtikr removed the info-needed Issue requires more information from poster label Feb 4, 2023
@romanrev
Copy link

romanrev commented Feb 28, 2023

sometimes seemingly irregularly while the app is running

Once microsoft/vscode-jupyter#12719 is taken care of, this should stop happening automatically.

Please choose a different interpreter via Python: Select Interpreter command to avoid this issue.

I'm also experiencing this issue. I've set the Python: Default Interpreter Path but the prompt keeps popping up still. I could not find the Python: Select Interpreter setting as advised.

Update: Disabling Jupyter extension seems to have solved the issue. Die Jupyter.

@karrtikr
Copy link

karrtikr commented Mar 1, 2023

Ok, that brings up the pop-up. So what might be the issue here?

The issue is to due to python itself, so please either install developer tools as it says, or disable the Jupyter extension for now.

More context, python extension looks for python envs in the system, one of which it finds is /usr/bin/python3. To check if it's a valid path or not, the extension runs a simple script using that interpreter, which leads to the popup. Closing this as there's not much to do be done here from extension's side.

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Mar 1, 2023
@HenriManninen
Copy link
Author

Indeed, after disabling Jupyter extension, the pop up hasn't appeared. Thanks for the tip!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2023
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 triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

4 participants