0

I am working in a Python environment in Anaconda. When using the command pip install jwst I initially obtained the error "Microsoft Visual C++ 14.0 or greater is recquired", which persisted even after I downloaded the most recent version of Visual Studio Build Tools. I followed a suggestion given in the answer to a similar question and wrote pip install libpython m2w64-toolchain -c msys2.

Now, I get a different error:

 LINK : fatal error LNK1104: could not open file 'build\temp.win-amd64-cpython-311\Release\Users\***\AppData\Local\Temp\pip-install-l5rn428c\drizzle_7ef4190d35d0411caabe45eb6792130b\src\cdrizzle.cp311-win_amd64.exp'
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\bin\\HostX86\\x64\\link.exe' failed with exit code 1104
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for drizzle
Failed to build drizzle
ERROR: Could not build wheels for drizzle, which is required to install pyproject.toml-based projects

I found a question that's similar to mine in which someone suggests that the error is caused by a x86 version of Visual Studio Build Tools being used on a 64-bit computer. It does seem that my version on Visual Studio Build Tools uses a 32-bit compiler, however I can't seem to find a different version. The thread is also quite old, so I'm not sure if this would work in the first place.

  • It's possible that "wheel" isn't installed. Try running "pip install wheel" as suggested over at https://stackoverflow.com/questions/53204916/what-is-the-meaning-of-failed-building-wheel-for-x-in-pip-install – Orion the Constellation Jun 22 '23 at 02:11
  • 1
    Thank you, but I've already done this too. I tried it again just to make sure and it said "Requirement already satisfied". – periwwinkle Jun 22 '23 at 02:18

1 Answers1

-4

The error you are encountering seems to be related to the build process of the "drizzle" package, which is a dependency of the "jwst" package you are trying to install. The error message suggests that the linker (link.exe) is unable to find a specific file it needs for the build.

One possible cause of this issue could be the presence of certain characters in your Windows username (such as spaces or non-ASCII characters), which can sometimes cause problems with the build process. You can try creating a new user account on your computer with a simpler username (e.g., without spaces or special characters) and then installing the packages using that account.

If changing the username doesn't resolve the issue, you can try the following steps:

Ensure that you have the latest version of Visual Studio Build Tools installed. You mentioned downloading the most recent version, but it's worth double-checking if any updates are available.

Make sure you have the 64-bit version of Visual Studio Build Tools installed. If you currently have the 32-bit version, uninstall it and install the 64-bit version instead. This is important because you mentioned working on a 64-bit computer.

Open the Visual Studio Installer and ensure that the required components for C++ development are selected. You can find the Visual Studio Installer in your Start menu or by searching for "Visual Studio Installer" in the Windows search bar. In the installer, select the "Modify" option for your installed version of Visual Studio Build Tools and check if the following components are installed:

MSVC v142 - VS 2022 C++ x64/x86 build tools Windows 10 SDK (latest version) After verifying the installation and components, open the Anaconda Prompt or your command-line interface and try installing the "jwst" package again using the pip install jwst command.

If the issue still persists, it might be helpful to check for any additional error messages or logs generated during the build process. These logs could provide more specific information about the cause of the error, and you can investigate further or seek assistance based on those details.

Please note that the specific steps may vary depending on your system configuration and the version of Visual Studio Build Tools you have installed. It's always a good idea to refer to the official documentation or support resources for the tools you are using for more accurate and up-to-date information.

Anass
  • 2,101
  • 2
  • 15
  • 20
  • First, thank you for the thorough answer ! 1-My username is made up of English alphabet letters. 2-I double checked my version of Visual Studio Build Tools. 3-I'm confused as though whether it's the VSBT installer that's supposed to be 64-bit, or if it's the command prompt? It seems that the installer is 32-bit as it was installed in the "Program files (x86)" directory on my computer, while the command prompt is 64-bit according to Task Manager. 4-I have checked off "MSVC v142 - VS 2022 C++ x64/x86 build tools Windows 10 SDK". 5-There are no other error messages apart from the ones I've shown. – periwwinkle Jun 22 '23 at 02:57
  • can be an issue with the compilation process. The error message indicates that the build tools are unable to find a specific file needed for linking (cdrizzle.cp311-win_amd64.exp). Ensure that you have the necessary build tools installed by running the following command in your Anaconda prompt: conda install -c anaconda build-tools Next, try installing the jwst package again using pip: pip install jwst – Anass Jun 22 '23 at 03:06
  • 2
    Could you precise what you mean by "ensuring that you have the necessary build tools installed"? I typed the command and recieved the message: "PackagesNotFoundError: The following packages are not available from current channels: - build-tools". When looking up build-tools on Anaconda, I only found a package called g-ir-build-tools that was compatible with my operating system (Windows 11). I installed it, but the message stays. – periwwinkle Jun 22 '23 at 04:09
  • 3
    This answer looks like a copy-paste from ChatGPT – DavidW Jun 22 '23 at 06:48
  • 2
    This answer looks like it was generated by an AI (like ChatGPT), not by an actual human being. You should be aware that [posting AI-generated output is officially **BANNED** on Stack Overflow](https://meta.stackoverflow.com/q/421831). If this answer was indeed generated by an AI, then I strongly suggest you delete it before you get yourself into even bigger trouble: **WE TAKE PLAGIARISM SERIOUSLY HERE.** Please read: [Why posting GPT and ChatGPT generated answers is not currently acceptable](https://stackoverflow.com/help/gpt-policy). – tchrist Jul 04 '23 at 01:06