I have a python package that is failing to install due a dependency on Windows build tools.
Things I have tried:
Install latest version of Visual Studio 2017 (AFAIK it should contain Microsoft Visual C++ 14.0).
Install Build Tools for Visual Studio 2017 directly from here https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017.
Put C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools on my path explicitly.
Uninstall all of Visual Studio and try again.
So far no luck. I tried restarting the terminal, restarting the computer etc... I am using GitBash, which might be relevant, although it never causes me any problems otherwise.
When I installed the tools, I made sure to check the 'Visual C++ Build Tools' workflow which selected some subset of the many line items that were available under the Individual Components tab.
In my example below I'm installing a language model but I believe that my issue is more general than that. I'm finding it difficult to understand which of the many components are relevant to my task. What I would like to know is: how do I validate that I have the build tools configured correctly and that I have the correct version? Any advice or guidance here would be much appreciated.
error:
$ pip36 install https://github.com/kpu/kenlm/archive/master.zip
Collecting https://github.com/kpu/kenlm/archive/master.zip
Downloading https://github.com/kpu/kenlm/archive/master.zip (526kB)
Installing collected packages: kenlm
Running setup.py install for kenlm: started
Running setup.py install for kenlm: finished with status 'error'
Complete output from command c:\users\ks99999999\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ks99999999\\AppData\\Local\\Temp\\pip-tfn5ym94-b uild\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close ();exec(compile(code, __file__, 'exec'))" install --record C:\Users\ks99999999\AppData\Local\Temp\pip-r2e ogfmd-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'kenlm' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http: //landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command "c:\users\ks99999999\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptool s, tokenize;__file__='C:\\Users\\ks99999999\\AppData\\Local\\Temp\\pip-tfn5ym94-build\\setup.py';f=getatt r(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __ file__, 'exec'))" install --record C:\Users\ks99999999\AppData\Local\Temp\pip-r2eogfmd-record\install-rec ord.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ks99999999\Ap pData\Local\Temp\pip-tfn5ym94-build\
Microsoft Visual Studio doesn't ship out-of-box with any VC compiler (or any compiler generally). Your installation is modularized, so you will have to make sure that you did, in fact, install a visual c++ with your installation of VS2017. Moreover, IIRC, VS2017 ships with Microsoft Visual C++ 15.0. You can install the 14.0 compiler with the Standalone Microsoft Visual Studio 2015 build tools. Make sure you have the correct setuptools version as well.
You can check which version of MSVC is installed by looking at Start Menu -> Add / Remove Programs and checking in the list of installed programs.
Related
I am trying to install pyodbc, and I am getting the below error.
C:\Python\Python37\Scripts>pip3 install pyodbc
Output
Collecting pyodbc
Using cached https://files.pythonhosted.org/packages/aa/71/cef225c4889620a1a00251d24c1746fe0cf4124290a75d1c2dc5c187b61f/pyodbc-4.0.23.tar.gz
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
Complete output from command c:\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Alankar\\AppData\\Local\\Temp\\pip-install-7qf14pkz\\pyodbc\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Alankar\AppData\Local\Temp\pip-record-k11gmg0x\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'pyodbc' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
Command "c:\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Alankar\\AppData\\Local\\Temp\\pip-install-7qf14pkz\\pyodbc\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Alankar\AppData\Local\Temp\pip-record-k11gmg0x\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Alankar\AppData\Local\Temp\pip-install-7qf14pkz\pyodbc\
I couldn't get the C++ build tools method to work, but I found this method to be very straightforward:
Download the relevant pyodbc wheel (pre-compiled binary) based on your computer's architecture and version of Python: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc
Run pip install <wheel path>.
For example:
pip install c:\users\bob\downloads\pyodbc-4.0.27-cp38-cp38-win_amd64.whl
Some Libraries require C++ build tools to install. In your case, to solve this problem there are two methods which are:
Update the pip's Setup tool:
To fix your error update the setup tool by this command:
pip install --upgrade setuptools
And the second method is to:
Install the Microsoft Visual C++ Build Tools
This can also be fixed by installing this little tool provided by Microsoft:
https://visualstudio.microsoft.com/visual-cpp-build-tools/
the install failed on my machine even after I installed Microsoft VC++ build tools, my solution for this is install an early version. the newer version assume you have VC++ and VS 2019 installed.
run this command
pip install -Iv pyodbc==4.0.27
If none of the other answers work:
I was running the newest version of python and it was giving me this error.
As soon as I downgraded to 3.8.x it worked like a charm using pip install
I'm working on a crypto trading bot to interface with the Binance API. There has been a toolkit somebody has developed to interface with Binance easier (I haven't spent the time to learn Python HTTP Requests for REST APIs yet) and I am attempting to install this toolkit, which is where I am running into trouble.
The module wiki can be found here: https://python-binance.readthedocs.io/en/latest/
The error occurs while using !pip install python-binance in Spyder. I keep getting an error and have spent hours repairing my Visual C++ 2015, 2017, etc. and trying to find them to add to my python path in case that was the issue.
Omitting all of the installation steps it spits out in my python console, it errors once it reaches this point every time. Unfortunately that landing hub link page isn't found. I've gone to Microsoft and updated to the latest versions as well. I'm guessing this has somethign to do with my paths in spyder, but I can't even find the Visual files in my computer beyond Visual Studio 8.
building 'twisted.test.raiser' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools":
http://landinghub.visualstudio.com/visual-cpp-build-tools
---------------------------------------- Failed building wheel for Twisted Command "c:\users\g\anaconda3\python.exe -u -c "import
setuptools,
tokenize;file='C:\Users\G\AppData\Local\Temp\pip-install-eyvyab9r\Twisted\setup.py';f=getattr(tokenize,
'open', open)(file);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, file, 'exec'))" install
--record C:\Users\G\AppData\Local\Temp\pip-record-vdboumt8\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in C:\Users\G\AppData\Local\Temp\pip-install-eyvyab9r\Twisted\"
Here is the environment:
OS:windows 10
Django:2.0rc
Python:3.6
pip:10.0.0
visual studio community 2017
And the error message:
running build_ext
building 'twisted.test.raiser' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual
C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
Command "c:\users\airy\appdata\local\programs\python\python36\python.exe -u -c "import setuptools,
tokenize;__file__='C:\\Users\\Airy\\AppData\\Local\\Temp\\pip-install-0a1gjuaj\\twisted\\
setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code,
__file__, 'exec'))" install --record C:\Users\Airy\AppData\Local\Temp
\pip-record-k1vjz5aa\install-record.txt --single-version-externally-managed
--compile" failed with error code 1 in C:\Users\Airy\AppData\Local\Temp\pip-install-0a1gjuaj\twisted\
I have already installed the build tools following the link description but it still doesn't work. If someone has solved it, please tell me how to fixed it.
Download twisted from this link.
Downloading Twisted‑18.4.0‑cp36‑cp36m‑win32.whl worked for me because I'm using Python 3.6. Download the version according to the python that you use.
After you download Twisted from the given link, open up a cmd where the file is located and run pip install Twisted‑18.4.0‑cp36‑cp36m‑win32.whl. pip will install Twisted from this file.
If you're doing it in a virtualenv, activate the virtualenv and install Twisted after that in the same process.
After that, you'll be able to install channels or whatever.
if you followed the instructions as mention by #rahim.nagori and encounter the problem as mention by #DiptangsuGoswami. just download the 32bit version of twisted or 64bit (if what you used previously was 32bit). it worked for me!
I use this command for installing MySQL client:
pip install mysqlclient
And then I see this problem:
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279
Cleaning up... Command C:\Python34\python.exe -c "import setuptools,
tokenize;file='C:\Users\Jayed\AppData\Local\Temp\pip_build_Jayed\mysqlclient\setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file,
'exec'))" install --record
C:\Users\Jayed\AppData\Local\Temp\pip-l4c6dhkk-record\install-record.txt
--single-version-externally-managed --compile failed with error code 1 in C:\Users\Jayed\AppData\Local\Temp\pip_build_Jayed\mysqlclient
Storing debug log for failure in C:\Users\Jayed\pip\pip.log
Actually I went down this path. While I suppose you can find all the libraries and components you need to get the client to compile, it is telling you it can't find a compiled copy of the client and is trying to compile it to install it.
Follow the instructions here: https://pypi.org/project/mysqlclient/ (it has notes about windows doing what you are describing) or download the wheel file (from downloads link on the page) and type
pip install mysqlclient.whl
and it will install without demanding C++ in order to use mysql with python.
I am trying to install Scrapy.
I am getting this error. I know there are many questions exists on SO but none of a solution has worked for me.
building 'twisted.test.raiser' extension
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
----------------------------------------
Command "c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Mani\\AppData\\Local\\Temp\\pip-build-eav78sdn\\Twisted\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Mani\AppData\Local\Temp\pip-19_gmj4b-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Mani\AppData\Local\Temp\pip-build-eav78sdn\Twisted\
I have these things installed in my computer
I have System Variable name:value is VS100COMNTOOLS:VS140COMNTOOLS
I also have OpenSSL installed in OpenSSL-Win64 and added to Windows PATH
I also have Microsoft Visual C++ Compiler for Python 2.7 installed.
What should I do? I have tried all solutions provided on SO but none worked.
I got this working.
Usually these require very particular versions of the Visual studios C++ compiler. In this case, following the steps listed on this page for the "Microsoft Visual C++ 10.0 standalone: Windows SDK 7.1" worked for getting twisted running (which is the package that's screwing up in this case)
If that doesn't work, you can find unofficial wheels here (learn more on wheels in general here)
Download the correct wheel (in this case, twisted) and follow these instructions to install it.
Hope this helps.