"ERROR: Could not build wheels for greenlet, lxml" during SCT v6.0 Installation on macOS

For greenlet:

      fatal error: too many errors emitted, stopping now [-ferror-limit=]
      20 errors generated.
      error: command '/Users/fmuhamma/Downloads/yes/bin/clang' failed with exit code 1
      [end of output]
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for greenlet

For lxml:

      In file included from src/lxml/etree.c:96:
      /Users/FMUHAMMA/sct_6.0/python/envs/venv_sct/include/python3.9/Python.h:25:10: fatal error: 'stdio.h' file not found
      #include <stdio.h>
      1 error generated.
      Compile failed: command '/Users/fmuhamma/Downloads/yes/bin/clang' failed with exit code 1
  ERROR: Failed building wheel for lxml

Full log: install_sct_log.txt (102.2 KB)

Successfully built docopt pathtools pystrum transforms3d
Failed to build greenlet lxml
ERROR: Could not build wheels for greenlet, lxml, which is required to install pyproject.toml-based projects

Hmm. Reading through the installation log, I’m noticing several references to a specific directory:


It seems that you may have installed the macOS developer tools (e.g. clang) to a specific folder in your Downloads ("~/Downloads/yes/"). And, it seems like there may be a problem with this installation.

To fix this, could you please try running the following commands in your terminal?

  1. Delete the previous installation folder (“/Users/FMUHAMMA/sct_6.0/”)
  2. Install developer tools to “/Library/Developer/CommandLineTools/
    xcode-select --install
  3. Set the SDK directory to the system developer directory.
    export SDKROOT="/Library/Developer/CommandLineTools"
  4. Re-run the SCT installer. (Make sure to use the same terminal window as the previous commands.)

If this does not work, could you please run the following debugging commands, then share the output?

xcode-select --print-path
xcrun --show-sdk-path
xcrun --sdk macosx --show-sdk-path
echo ~/Downloads/yes
echo /Library/Developer/CommandLineTools

Kind regards,

Thank you for responding to my request. What do you suggest I do to build the binary wheel packages?

Please ignore the initial reply, The installation error still persist.
install_sct_debug (25.5 KB)
install_sct_log.txt (85.3 KB)
install_sct_log.txt (3.1 KB)

My apologies! I forgot a step in my instructions. I have edited my post accordingly.

Could you please retry the steps from my earlier comment?

Also, could you please copy and paste the output from the following commands? It will help me greatly in understanding the problem.

Kind regards,

install_sct_log.txt (84.0 KB)
Please see the attached log.

Could you please provide the output of the terminal commands listed in my previous comment?

Thank you kindly,

Sorry about that. Please see attached file
Terminal Saved Output_8.18.23 (245.6 KB)

Thank you very much. My apologies that my suggestion did not fix your issue.

Could you please try the following steps?

  1. Please run the following command in your terminal and share the output with me:

    echo -e ${PATH//:/\\n}
  2. Rename the folder “Downloads/yes/” to "Downloads/yes_backup/" (This is just temporary, and you can always rename it back to its original name afterwards.)

  3. Rerun the SCT installer one more time.

My hunch is that the developer tools inside of “yes/” are being prioritized over the ones in "/Library/Developer/CommandLineTools due to the $PATH variable. So, to fix this, we temporarily rename the “yes/” folder so that the correct tools will be used instead.

Kind regards,

Interesting. So, you have both FSL and your macOS developer tools installed to yes/, then? In that case, renaming the yes/ folder will affect your FSL installation… :thinking:

Basically, my goal is avoid using the copy of clang inside the yes/bin/ folder, while also preserving the rest of the utilities inside of yes/ (FSL, etc.)

Could you please try the following commands:

# 1. Go into the folder with the SCT v6.0 source files
cd ~/sct_6.0
# 2. Remove the `yes/bin` folder from the $PATH variable
export PATH=$(echo $PATH | tr ":" "\n" | grep -v "Downloads/yes/bin" | tr "\n" ":")
# 3. Double check that it has been removed from the list of paths
echo -e ${PATH//:/\\n}
# 4. Re-run the SCT installer

Thank you kindly for your patience and understanding as we fix this issue.

Kind regards,

Thank you for helping me in getting this issue resolve. This is the Terminal output after I tried the above commands.
Terminal Saved Output_2.52pm (310.2 KB)

The is the output from the Terminal after I ran steps 1., 2, and 3

Thank you

Thank you so much for the detailed log and screencaptures.

It looks like my suggestions were able to switch us from “Downloads/yes/bin/clang” to “/usr/bin/clang” (this is a good sign! :tada:). There are fewer errors than before, too. However, some of the errors still remain, even when the expected tools are used:

The error for lxml, for example, is this:

      cc -I/Library/Developer/CommandLineTools/usr/include -I/usr/include/libxml2 -c /var/folders/9y/fz81lr6n7yx98800mstcqgb80000gp/T/xmlXPathInitpnlk9mt9.c -o var/folders/9y/fz81lr6n7yx98800mstcqgb80000gp/T/xmlXPathInitpnlk9mt9.o
      /var/folders/9y/fz81lr6n7yx98800mstcqgb80000gp/T/xmlXPathInitpnlk9mt9.c:1:10: fatal error: 'libxml/xpath.h' file not found
      #include "libxml/xpath.h"
      1 error generated.
      Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
      Perhaps try: xcode-select --install
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

This is strange, because clearly you have been running xcode-select --install many times, and it is already installed! :sweat_smile:

(Many of the support threads on the internet also suggest “xcode-select --install” for the errors that are being raised here. Again, not very helpful for us!!)

Because of this, I believe that there might be something broken/misconfigured with the existing Command Line Tools installation on your machine. However, it is difficult for me to pinpoint the exact issue from afar, as there are many possible causes/fixes for these errors.

The best advice I can think of right now is to start fresh, by uninstalling and then reinstalling the command line tools:

  1. Follow the steps on: Uninstall Xcode Command Line Tools · Mac Install Guide
  2. After confirming that the command line tools have been removed, please re-run the "xcode-select --install" command. This time, it should actually reinstall the tools.
  3. Then, please close the terminal window, then open a new terminal window, so that the changes will take effect for the new terminal window.
  4. Then, try the steps from my earlier comment once more.

Thank you kindly,

Hi Joshua,
Thank you for your help. While Xcode seems to have installed correctly, I’m facing issues with the code installation agin. There might be compatibility issues with MacOS system. I tried your instructions on my laptop, and it SCT 6.0 installed seamlessly!
I appreciate all you help.

1 Like

I’m so glad to hear that you were able to get SCT v6.0 installed correctly. Please feel free to continue to use the forum for any further questions or concerns you may have. :blush:

Kind regards,