Data-Oriented-House / PortableBuildTools

Portable VS Build Tools installer
595 stars 19 forks source link

pip still not recognizing installation #4

Closed bzv3 closed 3 months ago

bzv3 commented 6 months ago

I have installed PortableBuildTools, ensured that all the relevant paths are on my %PATH% as well as other system environment variables, and rebooted my machine as per the GUI installer instructions.

And pip still cannot build modules that require Microsoft Visual C++ 14.0 or higher.

I have killed/restarted the terminal in VS Code where I am working.

Any further suggestions? Thanks!

Donaldduck8 commented 5 months ago

You may need to set an environment variable called "DISTUTILS_USE_SDK" to "1". After doing that, I was able to pip install netifaces which requires build tools.

For reference, see https://github.com/pypa/setuptools/blob/0156e248e777eebff9250d83603611585d0c8f12/setuptools/msvc.py#L182C9-L182C26

SolarScuffle-Bot commented 5 months ago

Pip seems to be using vswhere to try and locate the toolchain, but that program is absent in PortableBuildTools. Unfortunately, detecting Windows development toolchain is a pure heuristic, and everyone does it differently, there is simply no reliable fix to that. You can use a workaround provided by @Donaldduck8 if it works for Pip, but this program is really meant for native Windows development using C/C++ compilers or other systems programming languages like Odin or Jai. Other things can work if this installation really has everything they need, but I would recommend installing the full Visual Studio just to be safe. - Hikari

j-begin commented 3 months ago

I am closing this for now.