Spyder: Spyder prompts to install command line tools in macOS

Created on 30 Mar 2020  路  26Comments  路  Source: spyder-ide/spyder

Issue Report Checklist

  • [Y ] Searched the issues page for similar reports
  • [Y] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [Y] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [Y ] Could not reproduce inside jupyter qtconsole (if console-related)
  • [Y ] Tried basic troubleshooting (if a bug/error)

    • [Y ] Restarted Spyder

    • [Y ] Reset preferences with spyder --reset

    • [Y ] Reinstalled the latest version of Anaconda

    • [Y ] Tried the other applicable steps from the Troubleshooting Guide

  • [Y ] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Installed the new version of spyder today. Everytime i click to a different tab a prompt appears as which asks to install Xcode, saying git is a part of Command Line Developer Tools. plz see the image I have attached.
Its really annoying and I dont want to install Xcode. What can be done to remove this prompt to appear?

What steps reproduce the problem?

  1. Installed the latest version of spyder, which removed a lot of packages which i reinstalled manually using pip install
  2. opening two or more files as different tabs and clicking any of them causes this to appear

Versions

  • Spyder version: 4.1.1
  • Python version: 3.7.0 64-bit
  • Qt version: 5.12.7
  • PyQt version: 5.12.3
  • Operating System name/version: MacOs Mojave 10.14.6
    Error
MacOS Editor Bug

Most helpful comment

Thank you for your help! We really appreciate it! We will merge the PR soon so we don't have this issue on our next release which should be available next week :)
@ccordoba12 please merge the PR!

All 26 comments

Did you install Spyder using your system Python?

no the anaconda navigator

Then why did you use pip to install Spyder? I don't get it.

ok, so first I tried updating through ipython in spyder itself which removed many packages like pandas, matplotlib, seaborn. then i removed it from anaconda navigator and re installed it, so it was a fresh install.

Still using the Python that comes with Anaconda? Or did you remove Anaconda completely?

Please be more specific.

Yes I am still using everything else as it is. Spyder was working fine with the older version but the problem started after i planned to update it. at first i tried:

  1. pip install --update spyder (this created a lot of problems)
  2. Removed spyder from anaconda nav
  3. installed spyder from anaconda nav

pip install --update spyder (this created a lot of problems)

I'm sure it did, and more so since you run it inside Spyder itself. Look, conda and pip packages are binary incompatible, so if you're using Anaconda you should avoid using pip as much as possible.

Besides our IPython console is not meant to run system commands like pip and conda, which must be run in Terminal.app.

Finally, you could have touched your system Python by using pip and that's why you're having this problem now.

Unfortunately we can't help you with the mess you did and the problem you're having now (you're the first person to report something like this). So simply accept to install the command line tools by clicking the Install button. That won't install Xcode, just some utilities that you'll find useful in the future anyway.

pip install --update spyder (this created a lot of problems)

I'm sure it did, and more so since you run it inside Spyder itself. Look, conda and pip packages are binary incompatible, so if you're using Anaconda you should avoid using pip as much as possible.

Besides our IPython console is not meant to run system commands like pip and conda, which must be run in Terminal.app.

Finally, you could have touched your system Python by using pip and that's why you're having this problem now.

Unfortunately we can't help you with the mess you did and the problem you're having now (you're the first person to report something like this). So simply accept to install the command line tools by clicking the Install button. That won't install Xcode, just some utilities that you'll find useful in the future anyway.

Well, I admit I may have done it the wrong way. But I solved it, by downgrading it to version 3.6.
Thanks anyway.

Problem Description

I have the same issue as the original poster exactly as previously described. I have a new mac laptop with a fresh install of the command line version of Anaconda3 and Spyder that have been updated using conda update --all and conda update spyder from the terminal command line. When I try and proceed with the installation, I get an error that says "Can鈥檛 install the software because it is not currently available from the Software Update server." I do recognize that I have an Mac OS update available and I am not connected to the App Store. I am borrowing this computer, so I do not plan on updating the OS or connecting to the App Store. Even though the installation fails, the message keeps popping up when I open Spyder and click on open file tabs.

I recognize that a solution is to downgrade to Spyder 3.6, but I thought it would be useful to open this issue up again for Spyder 4 since in my case it is not due to an incorrect installation or pip usage.

Versions

Spyder version: 4.1.5
Python version: 3.8.1 64-bit
Qt version: 5.9.7
PyQt version: 5.9.2
Operating System name/version: MacOs Catalina 10.15.3

Hey @tfetherolf, thanks for the feedback and the details about your setup. I understand the hurdle this is causing for you to use Spyder. I'll reopen the issue and we'll try to fix it for our next release.

Hi @tfetherolf and @pydpyper. I've been trying to figure this out but I haven't really found a way to reproduce this error. However, it seems like the problem is the "git wrapper" mentioned in this issue https://github.com/docksal/docksal/issues/1003

Can you please try running this command xcode_tools_dir=$(xcode-select -p 2>/dev/null) && ls ${xcode_tools_dir}/usr/bin/git in your terminal and print here the output. This will give us a way to detect correctly whether git is installed or not and fix this problem in Spyder.

@juanis2112 I get "Illegal variable name." when I try running that line in terminal, even when adding sudo at the beginning. Looking at the the thread you posted, which git does return /usr/bin/git and using git --version brings up the same pop-up window.

As an update to my previous post, I have my personal laptop back and it has been updated to macOS 10.15.7 and has the same issue. This laptop was returned to me with a factory reset (had to get a bunch of components replaced), so anaconda3+spyder4 were freshly installed on this computer as well.

Are you using tcsh or csh in your command line? Cause I tried with these two and I get the same error. However it works fine in bash or zsh. Can you try running the command in any of these two?

@juanis2112 I do default use tcsh. I switched to bash and zsh and both successfully ran the xcod_tools_dir line, but there was no output.

Sorry, my bad. You need to run echo $?after the previous command.
Try:

xcode_tools_dir=$(xcode-select -p 2>/dev/null) && ls ${xcode_tools_dir}/usr/bin/git
echo $?

Ah, right! The output is "2". This does not surprise me, since I have not done anything to install git or xcode.

That's great. It means we've figured out a way to check whether git is installed or not. I'll implement the fix as soon as possible so we don't have this error in our next version of spyder (4.2) to be released in November.

Thank you very much for your help!

Hi @tfetherolf. I already fixed this issue, but as I told you I couldn't reproduce the error so I can't test the fix. Could you help us testing this before merging?
To do this, you need to do the following:

  1. Go to this link https://github.com/spyder-ide/spyder/pull/14105, to the PR that fixes the issue.
  2. Scroll down until the checks section and to the right of "All checks have passed", click "Show all checks".
    Screenshot 2020-11-01 at 9 12 46 PM

  3. Click "Details" in the "Create macOS App Bundle and DMG" label.
    Screenshot 2020-11-01 at 9 13 24 PM

  4. Click the dropdown next to "Artifacts" in the left of the page.
    Screenshot 2020-11-01 at 9 14 47 PM

  5. Click the Spyder-Lite.dmg file to download Spyder.

  6. Go to your downloads folder and click on the Spyder-Lite.dmg file to install spyder.

  7. Drag Spyder to "Applications" in the dialog that appears after opening the dmg

Screenshot 2020-11-01 at 9 19 01 PM

  1. Go to your applications and open Spyder.

After you do this, please let me know if the command line tools dialog appears.

I've downloaded it now, hope to solve this issue with you :)

Thanks @TommyMagic97! Let me know if the issue is solved! FYI the Mac installer only works in Catalina 10.15.

@juanis2112 The dialog message appears when I first open Spyder and when I open a new project, but it no longer continuously pops up when I look at different files in the current project or try to save any files, which is definitely a big improvement!! Personally, I don't mind the dialog box "reminding" me to install git every time I open Spyder or a new project, since I am not performing these actions every few minutes.

Thanks @tfetherolf for testing this. I will try to fix this other minor issue and let you know to see if you can help us test again!

Hi @tfetherolf, I updated the PR and hopefully this solve the issue. Will you please try the application again (with the installers as I explained) and let me know?

@juanis2112 This time in my tests I did not have any instances of the dialog messaging coming up at all! Thank you!

Thank you for your help! We really appreciate it! We will merge the PR soon so we don't have this issue on our next release which should be available next week :)
@ccordoba12 please merge the PR!

On it @juanis2112! And thanks again for your help @tfetherolf!

Was this page helpful?
0 / 5 - 0 ratings