Django channels install failure in Windows 10 - python

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!

Related

"Microsoft Visual C++ … is required" error when trying to install pyodbc on Windows

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

Installing Python package from source using Microsoft Visual Build Tools 2017

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.

Error while installing mysqlclient for python in Windows 10

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.

Installing requirements.txt

I am new to the Wagtail cms and am taking over a friend's project for his site.
I have downloaded his repo and am trying to get it to run locally. I have followed the steps on the wagtail documentation http://docs.wagtail.io/en/v1.12.1/getting_started/index.html
but in the site's requirements.txt file, there are some dependencies that just are not installing and giving errors:
here is the output of when trying to install the requirements:
build\lib.win32-2.7\psycopg2\_psycopg.pyd : fatal error LNK1120: 62 unresolved externals
error: command 'C:\\Users\\Adam\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\link.exe' failed with exit status 1120
Rolling back uninstall of psycopg2
Command "c:\python27\python.exe -u -c "import setuptools,
tokenize;__file__='c:\\users\\Adam\\appdata\\local\\temp\\pip-build-
bykm5e\\psycopg2\\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\Adam\appdata\local\temp\pip-
cidizd-record\install-record.txt --single-version-externally-managed --
compile" failed with error code 1 in c:\users\Adam\appdata\local\temp\pip-
build-bykm5e\psycopg2\
(The full output is here: https://pastebin.com/m1ukkei8)
Any help would be greatly appreciated - I am using Python 2.7 and have tried reinstalling psycopg and have installed postresql
Your windows linker is throwing out errors as you don't have c++ libraries for an extension to be built properly.
I would suggest to you to rather install it through wheel file
by running
pip install some-package.whl
I'm not sure if this is the answer, but the version of psycopg2 that you're using had a bug that prevented installation using pip, due to some bug in pip. Try version 2.5.3 and see if that fixes it.

error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat). while installing Scrapy on Windows 10 64-bit

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.

Categories

Resources