anaconda can't recognize Microsoft C++ Build Tools - python

I am a beginer who's just started learning PointCloud online. As I wanted to install one of the python library called torch-points-kernels, I failed. I input pip install torch-points-kernels in AnacondaPrompt, it returns the error information as shown below
building 'torch_points_kernels.points_cuda' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\colorama\ansitowin32.py", line 59, in closed
return stream.closed
ValueError: underlying buffer has been detached
----------------------------------------
ERROR: Failed building wheel for torch-points-kernels
Its error information says require Microsoft Visual C++ 14.0 or greater. However, I have downloaded Visual Studio 2019 Community along with some neccessary tools like the latest build tool. It shouldn't return me error messages like above.
After searching relevant issues, many have report they fix this problem by download and run VisualCppBuildTools_Full.exe, which will aotomatically install a build tool . I tried the same and reboot. Although i successfully install the build tool on my computer, however, the problem still remains the same.
Until now, i have two sets of build tools. One is nested in the visual studio, while the other one is a exe file lies in somewhere in my computer. Both of them satisfy the version demanding(greater than 14.0), but both of them can't work for this pip operation.
How can i get this work? Thanks in advance!

Start your visual studio command prompt (start menu followed by typing "x64 Native" will likely bring it up)
Activate anaconda from this terminal by running activate.bat (\Scripts folder)
run your pip command
A somewhat preferable alternative might be to start anaconda prompt and then activate the visual studio tools on top via its .bat. (you can trace that x64 Native shortcut to a vcvars bat file that you need to run with call). This is because some tools of anaconda packages also have a link.exe that might get called instead of the msvc one.

Related

Unable to install new python libraries

I just came back from vacation and after getting a bunch of windows updates, I am no longer able to work with my python env. All the libraries in my virtual env have stopped to work and I kept receiving error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Toolswhen trying to install them again.
I have installed Microsoft Visual C++ build tools again and now it works for some of them(pandas for example). However, for most of libraries(Office365-REST-Python-Client as an example), I am getting this :
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
Running setup.py clean for cryptography
Failed to build cryptography
Failed building wheel for cryptography
Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
BUT I do not have cryptography installed at this point. I have used it in one of my projects before and it seems like those leftovers are breaking something. However, I don't really know where to look for them. I have re-installed python(i have tried few versions as well) to a different location but the problem prevails. Problem occurs from Pycharm and command line.I am really confused so I would appreciate any advice!
Thank you in advance!
What I would suggest is to remove all Python versions and distributions.
Then re-install Python from python.org. You should probably use the "Windows x86-64 executable installer".
Download and install all Python modules you want as wheels (.whl extension). That way you shouldn't have to build anything yourself.

cannot install spacy package while trying to create python 3.6 azure function

I had an error while trying to install spacy package on python 3.6 azure function as it needs a c++ compiling as a prerequisite for installation so I got this error:
fatal error C1510: Cannot load language resource clui.dll.
error: command 'D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Bin\amd64\cl.exe' failed with exit status 4
Running setup.py clean for spacy
Failed building wheel for spacy
I've tried to use wheel but it's not supported for this package.
You have to install the C++ compiler that comes with Microsoft Visual Studio 15. It used to be a stand alone set of build tools one could install separately. Unfortunately, the stand alone build tools for Microsoft Visual C++ no longer exist. Instead Microsoft prefer you install their 6GB visual studio, which many old links direct to. Many of us realize that this requirement is despotic and want the stand alone installer back.
Despite Microsoft best efforts to redirect all hyperlinks to it (in blogs etc), to the new Visual Studio installed, the following location seems to host the older build tools for VS2015. However, it is going to be between 3gb and 6gb in size: https://visualstudio.microsoft.com/vs/older-downloads/
The size does not make any sense for just the C++ build tools. However, I am told this is correct. It seems in true MS fashion it ships with a lot of extra baggage most of users / developers will not even care about (I don't want to cross compile C++ for Arm etc).
The solution that was fit to me and solved this problem is to use Docker. I've created a custom image and installed my environment on Ubuntu and pushed this image to Azure and it works fine. I've followed the steps on this Link for deploying my docker image on Azure: learn.microsoft.com/en-us/azure/app-service/containers/…

Issue with installing geopandas

I'm trying to install geopandas on my laptop, a Windows 10 version 1709 machine.
After executing the pip install geopandas command, I'm getting the message:
command python setup.py egg_info failed with error code 1.
I already tried to upgrade pip and setuptools, but still no success. I installed Python 3.6.
Assuming you got something like this error:
File "C:\Users\Simon\Anaconda3\lib\site-packages\setuptools\msvc.py", line 848, in __init__
raise distutils.errors.DistutilsPlatformError(err)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Simon\AppData\Local\Temp\pip-build-2vl7e6lb\pyproj\
That error appears because you need to compile the package yourself. On Windows that requires build tools.
You just need to go to the link given to you in your error message and download Build Tools for Visual Studio 2017. Once you have done this, Try the installation command again. It should now work.
You can also find out more information from Windows Compilers
Experiencing the same problem, the only thing that worked for me after having tried the various solutions suggested here -- I'm using Jupyter Notebook on Anaconda -- was installing it through the anaconda platform [Environments]; I hope this helps someone.

scikits.sparse installation(or build) fails on windows and anaconda (spyder)

I have been trying to install scikits.sparse module in python. I feel that the module I obtained needs compilation. I guessed the same as it doesn't contain .py files, instead there is a cholmod.c and a cholmod.pyx file in the sparse directory. I attempted to do this in 2 ways,
One from Spyder, by first adding the module path to PYTHONPATH manager and then including the following lines in the program
import pyximport
pyximport.install()
from scikits.sparse.cholmod import cholesky
This gave me the error
ImportError: Building module scikits.sparse.cholmod failed:
["distutils.errors.CompileError: command 'C:\\Program Files
(x86)\\Microsoft Visual Studio
14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2\n"]
Second directly in Python 3.6,
I installed Microsoft Visual C++ build tools 14.0 (from Visual Studio 2015), which looked like completed installation, but the final status said, It may not have installed properly.
Then I updated pip,
installed cython, scipy and some other dependency of scikits.sparse
then on attempting installation like th following,
python e:\python\scikits.sparse-0.2\setup.py install
from command prompt returned an error,
Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with
exit status 2
Is there anyway to compile and build scikits.sparse in windows?
Alternatively, is it possible to compile it in a Linux system to a .whl and then install it easily in windows?
Thanks in advance.
You just need to install C++ build tool.
In my case it was the same as per yours i.e. "Microsoft Visual Studio 14.0"
So I installed C++ build tool from the link given below.[landinghub.visualstudio.com/visual-cpp-build-tools][1]
This showed me 2015 version, and that solved my issue.
Hope it's gonna work same for you too. If not, leave the comment below.
Good Luck !
scikits-sparse was not built for windows, only for linux

Python Tools for Visual Studio (September 2016) failed to install

I've tried on a couple of different computers to execute the suggested update for the Python Tools within Visual Studio 2015 (with most recent VS updates on Windows 7 - 64-bit) without luck. I get a message stating: "The selected Visual Studio item 'Python Tools for Visual Studio (September 2016)' failed to install. Check the %Temp% directory for VS install logs."
When reviewing the Windows\Temp directory there are no logs indicating any recent install failure.
What might I try to get the installation to work?

Categories

Resources