File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\distutils\mingw
dry_run, force)
File "C:\ProgramData\Anaconda3\lib\distutils\cygwinccompiler.py", line
if self.ld_version >= "2.10.90":
TypeError: '>=' not supported between instances of 'NoneType' and 'str'
Facing this error for a long time in my Python environment, I don't know if it's due to cygwin or not.
You need to add the 2 lines below to a new file called distutils.cfg to python/Lib/distils python installation. This will prevent "vcvarsall.bat" error or "Visual C++ requirement" error or NoneType error as seen in original question. (Assuming the "distutils.cfg" file did not exist)
[build]
compiler=mingw32.exe
(Note: The ".exe" portion is very important here, and many other guidelines tend to leave this out!)
Add patch to Python/Lib/disutils/cygwinccompiler.py. Change the get_msvcr() method, to the method seen in this file organized by myself to be python tab safe, or otherwise apply the change from the specific bug fix python page. (Note that the official page's code will yield an error if you copy it to your cygwinccompiler.py get_msvcr method, even after you remove the irrelevant plus signs, and ensure all things align. You'll need to delete the tabs, and replace them with the corresponding number of spaces.)
It is probably because you have not added the mingw directory to your Windows PATH. The cygwinccompiler.py
is trying to compare the version of your ld
to a specific version, but has received None
as the ld
version.
Check out the answer to this After installing minGW, gcc command is not recognized
for how two add mingw to your windows PATH.
After adding it to the path open a new cmd and try:
gcc -dumpversion
ld -v
dllwrap -version
If the commands are recognized you should be able to run cygwinccompiler.py
normally.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With