Related
I just ran the following command:
pip install -U steem
and the installation worked well until it failed to install pycrypto.
Afterwards I did the
pip install cryptography
command because I thought it was the missing package.
So my question is, how I can install steem without the pycrypto-error (or the pycrypto-package in addition) and how to uninstall the cryptography-Package which I don't need.
(I'm using Windows 7 and Python 3)
Requirement already up-to-date: python-dateutil in c:\users\***\appdata\lo
cal\programs\python\python36\lib\site-packages (from dateparser->maya->steem)
...
Installing collected packages: urllib3, idna, chardet, certifi, requests, pycryp
to, funcy, w3lib, voluptuous, diff-match-patch, scrypt, prettytable, appdirs, la
ngdetect, ruamel.yaml, humanize, tzlocal, regex, dateparser, pytzdata, pendulum,
maya, ecdsa, pylibscrypt, ujson, toolz, steem
Running setup.py install for pycrypto ... error
Complete output from command c:\users\***\appdata\local\programs\pytho
n\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\
***~1\\AppData\\Local\\Temp\\pip-build-k6flhu5k\\pycrypto\\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\***N~1\AppDat
a\Local\Temp\pip-igpkll6u-record\install-record.txt --single-version-externally-
managed --compile:
running install
running build
running build_py
...
building 'Crypto.Random.OSRNG.winrandom' 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\***\appdata\local\programs\python\python36\python.exe -u
-c "import setuptools, tokenize;__file__='C:\\Users\\***N~1\\AppData\\Local\\
Temp\\pip-build-k6flhu5k\\pycrypto\\setup.py';f=getattr(tokenize, 'open', open)(
__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __fil
e__, 'exec'))" install --record C:\Users\***N~1\AppData\Local\Temp\pip-igpkll6
u-record\install-record.txt --single-version-externally-managed --compile" faile
d with error code 1 in C:\Users\***N~1\AppData\Local\Temp\pip-build- k6flhu5k\p
ycrypto\
You need to install Microsoft Visual C++ 14.0 to install pycrypto:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
In the comments you ask which link to use. Use the link to Visual C++ 2015 Build Tools. That will install Visual C++ 14.0 without installing Visual Studio.
Alternate link: https://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.2_standalone:_Build_Tools_for_Visual_Studio_2019_.28x86.2C_x64.2C_ARM.2C_ARM64.29
In the comments you ask about methods of installing pycrypto that do not require installing a compiler. The binaries in the links appear to be for earlier versions of Python than you are using. One link is to a binary in a DropBox account.
I do not recommend downloading binary versions of cryptography libraries provided by third parties. The only way to guarantee that you are getting a version of pycrypto that is compatible with your version of Python and has not been built with any backdoors is to build it from the source.
After you have installed Visual C++, just re-run the original command:
pip install -U steem
To find out what the various install options mean, run this command:
pip help install
The help for the -U option says
-U, --upgrade Upgrade all specified packages to the newest available
version. The handling of dependencies depends on the
upgrade-strategy used.
If you do not already have the steem library installed, you can run the command without the -U option.
If you already have Visual Studio Build Tools installed but you're still getting that error, then you may need to "Modify" your installation to include the Visual C++ build tools.
To do that:
Open up the Visual Studio Installer (you can search for it in the Start Menu if needed).
Find Visual Studio Build Tools and click "Modify":
Add a checkmark to Visual C++ build tools and then click "Modify" in the bottom right to install them:
After the C++ tools finish installing, run the pip command again and it should work.
I got this error when I tried to install pymssql even though Visual C++ 2015 (14.0) is installed in my system.
I resolved this error by downloading the .whl file of pymssql from here.
Once downloaded, it can be installed by the following command :
pip install python_package.whl
Hope this helps
I landed on this question after searching for "Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools". I got this error in Azure DevOps when trying to run pip install to build my own Python package from a source distribution that had C++ extensions. In the end all I had to do was upgrade setuptools before calling pip install:
pip install --upgrade setuptools
So the advice here about updating setuptools when installing from source archives is right after all:). That advice is given here too.
As an alternative to installing Visual C++, there is a way by installing an additional package in Conda (this option doesn't require admin rights). This worked for me:
conda install libpython m2w64-toolchain -c msys2
I faced the same problem. Found the fix here.
Basically just install this.
shasum output:
3e0de8af516c15547602977db939d8c2e44fcc0b visualcppbuildtools_full.exe
md5sum output:
MD5 (visualcppbuildtools_full.exe) = 8d4afd3b226babecaa4effb10d69eb2e
Run your pip installation command again. If everything works fine, its good. Or you might face the following error like me:
Finished generating code
LINK : fatal error LNK1158: cannot run 'rc.exe'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158
Found the fix for the above problem here:
Visual Studio can't build due to rc.exe
That basically says
Add this to your PATH environment variables:
C:\Program Files (x86)\Windows Kits\8.1\bin\x86
Copy these files:
rc.exe
rcdll.dll
From
C:\Program Files (x86)\Windows Kits\8.1\bin\x86
To
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin
It works like a charm
Pycrypto has vulnerabilities assigned the CVE-2013-7459 number, and the repo hasn't accept PRs since June 23, 2014.
Pycryptodome is a drop-in replacement for the PyCrypto library, which exposes almost the same API as the old PyCrypto, see Compatibility with PyCrypto.
If you haven't install pycrypto yet, you can use pip install pycryptodome to install pycryptodome in which you won't get Microsoft Visual C++ 14.0 issue.
Updated link here for download Microsoft Visual C++ 14.0
Download
It works for me without a Visual Studio downloader
On Windows, I strongly recommand installing the latest version of Visual Studio Community. It's free, you will maybe miss some build tools if you only install vc_redist, so you can easily install package by pip instead of wheel, it save lot of time.
Try doing this:
py -m pip install pipwin
py -m pipwin install PyAudio
Three steps I follow for this error:
C++ Build tools are installed
pip install --upgrade setuptools
try using conda to install, conda may have the compiled version which won't need the build tools
None of the solutions proposed by other people here worked for me.
So in my case I had to uinstall ALL older versions
of Microsoft Visual C++ Redistributable from my computer:
Only the newest one (in my case 2015-2022) should be left!
After uinstalling I ran this command:
pip install <your_lib_name>
and everything worked great after that.
Killer solution: install nodejs and tick the option of install chocolatey and other necessary tools... and it will install the tools required to setup a development environment.
I installed python 3.7 on my Windows 10 laptop since it has been officially released as of today (06/28/2018). Then i tried to install numpy package using pip
pip install numpy
The install proceeds but finally fails with the below error :
source = func(extension, build_dir)
File "numpy\core\setup.py", line 675, in get_mathlib_info
raise RuntimeError("Broken toolchain: cannot link a simple C program")
RuntimeError: Broken toolchain: cannot link a simple C program
----------------------------------------
Command ""c:\program files\python37\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\pcheg\\AppData\\Local\\Temp\\pip-install-7wjkw5wn\\numpy\\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\pcheg\AppData\Local\Temp\pip-record-uhj8233f\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\pcheg\AppData\Local\Temp\pip-install-7wjkw5wn\numpy\
Any ideas as to how to overcome this install Error? Thanks.
Installing NumPy on Windows is a common problem if you don't have the right build setup. Instead, I always go to Christoph Gohlke's website to download the wheels you can install for your computer. Christoph generously builds the libraries himself with the right build environment and he posts it on his website.
Newer Instructions - For older instructions, please scroll down
First, install pipwin from PyPI which will install a utility that acts like pip but it will download the actual package you're interested in from his website, then use pipwin install to install the package you want.
First do:
pip install pipwin
When that's installed, you can then do:
pipwin install numpy
This will install the latest version of NumPy on your system. This way you don't have to specifically search for the version of NumPy that is for your specific version of Python.
Older instructions
Go to the NumPy section: https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy then download the version for 3.7 that is compatible with your version of Python (2 or 3 and 32-bit or 64-bit). For example, the filename numpy‑1.14.5+mkl‑cp37‑cp37m‑win_amd64.whl is for NumPy 1.14.5, Python 3.7 - 64 bit. You can pick out which version of NumPy and which version of the Python interpreter and bit version you need in the filename.
Doing this never requires you to build NumPy yourself or install the required compiler as opposed to installing NumPy through PyPI. You can just download the wheel and install it yourself. Assuming you've already downloaded it, just do:
pip install numpy‑1.14.5+mkl‑cp37‑cp37m‑win_amd64.whl
... assuming the wheel is in the directory you're currently in.
Starting 24 November 2021, latest numpy require at least Python 3.8
Note: This might not be the original question asked, but it might help anyone come here.
To use python 3.7, latest numpy you can use is v1.21.4. So, to install it, use:
pip install numpy==1.21.4
If you write requirements that you hope compatible with python 3.7, you can use numpy<=1.21.4
EDIT: in 20 December 2021, numpy release version 1.21.5 that support Python 3.7
From comment section, by #sam, numpy 1.21.5 support Python 3.7. It was released after 1.22.0rc1 (the latest numpy version as the writing of the original post) that only support Python 3.8++.
Lesson learned from this experience, it would be better to use <,
pip install numpy<1.22.0
or
install_requires = [
"numpy<1.22.0", # lates version to support python 3.7
],
For windows when you install a package you type in Python 3:
py -m pip install [packagename]
OR
py -m pip install numpy
You're probably missing a C compiler. If numpy doesn't provide a prebuilt wheel yet, you'll need to install a compiler. This website shows the one you need to install. For 3.7, I assume it's still 14.0, so you should install Microsoft Build Tools for Visual Studio 2017.
Let me know if that works.
I am trying to install TA-Lib for Python 3.7. I've already read through a number of solutions, but have come to a point I can't figure out. Here is the message I get from pip:
Collecting ta-lib
Using cached https://files.pythonhosted.org/packages/90/05/d4c6a778d7a7de0be366bc4a850b4ffaeac2abad927f95fa8ba6f355a082/TA-Lib-0.4.17.tar.gz
Requirement already satisfied: numpy in c:\python37_64\lib\site-packages (from ta-lib) (1.15.4)
Installing collected packages: ta-lib
Running setup.py install for ta-lib: started
Command "c:\python37_64\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Todd\\AppData\\Local\\Temp\\pip-install-0c2__0gf\\ta-lib\\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\Todd\AppData\Local\Temp\pip-record-3dpfanca\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Todd\AppData\Local\Temp\pip-install-0c2__0gf\ta-lib\
Running setup.py install for ta-lib: finished with status 'error'
Complete output from command c:\python37_64\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Todd\\AppData\\Local\\Temp\\pip-install-0c2__0gf\\ta-lib\\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\Todd\AppData\Local\Temp\pip-record-3dpfanca\install-record.txt --single-version-externally-managed --compile:
C:\Users\Todd\AppData\Local\Temp\pip-install-0c2__0gf\ta-lib\setup.py:79: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\talib
copying talib\abstract.py -> build\lib.win-amd64-3.7\talib
copying talib\deprecated.py -> build\lib.win-amd64-3.7\talib
copying talib\stream.py -> build\lib.win-amd64-3.7\talib
copying talib\test_abstract.py -> build\lib.win-amd64-3.7\talib
copying talib\test_data.py -> build\lib.win-amd64-3.7\talib
copying talib\test_func.py -> build\lib.win-amd64-3.7\talib
copying talib\test_pandas.py -> build\lib.win-amd64-3.7\talib
copying talib\test_stream.py -> build\lib.win-amd64-3.7\talib
copying talib\__init__.py -> build\lib.win-amd64-3.7\talib
running build_ext
building 'talib._ta_lib' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\talib
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\python37_64\lib\site-packages\numpy\core\include -Ic:\ta-lib\c\include -Ic:\python37_64\include -Ic:\python37_64\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tctalib/_ta_lib.c /Fobuild\temp.win-amd64-3.7\Release\talib/_ta_lib.obj
_ta_lib.c
talib/_ta_lib.c(524): fatal error C1083: Cannot open include file: 'ta_libc.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
FINISHED
Thanks.
Here is what works for me...
Download TA_Lib-0.4.10-cp27-cp27m-win_amd64.whl from here
And use command pip install TA_Lib-0.4.10-cp27-cp27m-win_amd64.whl
I was using Conda4 with python 3.6 64 bit version.
Another way also you can try
To install Ta-Lib with Python 3.6+, Windows 64 bit use this pip install -i https://pypi.anaconda.org/masdeseiscaracteres/simple ta-lib
The root cause of the error is probably because you haven't installed actual TA-Lib library which is written in C. Note that the python lib is just a wrapper on top of the actual library. So in order to have python wrapper successfully installed, you'll need to install its prerequisite (the actual TA-Lib).
See https://github.com/mrjbq7/ta-lib#dependencies for more details.
From above reference (for ease of access) :
Installing actual TA-Lib (prerequisite for python wrapper) :
Windows
Download ta-lib-0.4.0-msvc.zip and unzip to C:\ta-lib
Move the Unzipped Folder ta-lib to C:\
Download and Install Visual Studio Community 2015 if already not installed (Remember to Select [Visual C++] Feature)
open x64 Native Tools Command Prompt
navigate to C:\ta-lib\c\make\cdr\win32\msvc
type nmake (this command builds the library)
Linux
$ tar -xzf ta-lib-0.4.0-src.tar.gz
$ cd ta-lib/
$ ./configure --prefix=/usr
$ make
$ sudo make install
Mac OS X
$ brew install ta-lib
If you are using a M1 laptop and Homebrew, then you can set these before installing:
export TA_INCLUDE_PATH="$(brew --prefix ta-lib)/include"
export TA_LIBRARY_PATH="$(brew --prefix ta-lib)/lib"
Hint : It seems, by default, the setup.py reads actual library files from C:\ta-lib (in Windows) and /usr (in Linux). so if you move the downloaded zip file to another location and extract it there (for Windows) or set ./configure --prefix to any location other than /usr (for Linux), then you would have to set TA_LIBRARY_PATH and TA_INCLUDE_PATH environment variables to your desired locations.
If you installed the underlying TA-Lib library with a custom prefix (e.g., with ./configure --prefix=$PREFIX), then when you go to install this python wrapper you can specify additional search paths to find the library and include files for the underlying TA-Lib library using the TA_LIBRARY_PATH and TA_INCLUDE_PATH environment variables:
$ export TA_LIBRARY_PATH=$PREFIX/lib
$ export TA_INCLUDE_PATH=$PREFIX/include
$ python setup.py install # or pip install ta-lib
The documentation of Ta-lib package here is well clear:
https://github.com/mrjbq7/ta-lib
https://mrjbq7.github.io/ta-lib/
And as it was clearly mentionned! this python ta-lib library! Is a wrapper for the TaLib library at https://ta-lib.org/
This is a Python wrapper for TA-LIB based on Cython instead of SWIG
To know the ta-lib.org library is a library created in c lang! You can check here
And multiple binding and interfaces are made for different languages! Just as mentionned in the official website!
The python library is a binding for python that use cython! Which make it more efficient then SWIG!
Know that I'll insist on using pip! (it works all well and it's convenient)
For the installation to go well! You'll need to go in two steps! You need to install TaLib native library binaries first! Then install the python lib with pip (again with pip)! And this order is necessary! You can't go for installing the python binding before the first installation finish!
All that said!
Installation
Step 1: Installing Talib native binary
Installing the Ta-lib software (Or native library binary)! Is a must! And need to be done first!
Follow the instructions here:
https://github.com/mrjbq7/ta-lib#dependencies
The instructions are too clear and detailed!
(Linux users you need to execute the command with the right privelege (hince using sudo))
And last thing! You can check #Code_Worm answer in this thread here He explained many points highly well aboutt the instruction above !
I'll pin point too his hint:
Hint : It seems, by default, the setup.py reads actual library files from C:\ta-lib (in Windows) and /usr (in Linux). so if you move the downloaded zip file to another location and extract it there (for Windows) or set ./configure --prefix to any location other than /usr (for Linux), then you would have to set TA_LIBRARY_PATH and TA_INCLUDE_PATH environment variables to your desired locations.
Check the section bellow this hint!
You can check the trouble shooting section here
Step 2: Installing the python library using pip
Don't proceed with this step until the first step is successfully finished and done with!
Again the pip package and pip works well! And so no need to use some whl file from any other website and src! I'll show you how!
pip install TA-Lib
However here there is many things to say!
First you need to use python 3
So you may use pip3 instead of pip! If pip is resolving to the python2 version (which is common in linux installations)!
pip3 install TA-Lib
Now you may fall in this problem and error!
unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape)
AttributeError: 'HTMLParser' object has no attribute 'unescape'
IF such is the case! That's a problem that can come with python 3.9! (if you are using 3.8 you may not encounter that at all)!
The solution and fix is simple! We have just to make an upgrade to some packages! You can follow the instructions from the answer here:
https://stackoverflow.com/a/65640477/7668448
After some trial and error I upgraded, pip, distlib and setuptools and it solved it. Not sure which of those is causing it. (On the last two I found issues 1 2 of other sites)
It is caused by removing unescape from HTMLParser in python3.9, which seems to break setuptools.
pip3 install --upgrade setuptools
If it does not work, try also:
pip3 install --upgrade pip
pip3 install --upgrade distlib
That's it all! If the first step (step 1: Installing TaLib native binaries) is well done and finished! Then running pip3 install TA-Lib will works well this time!
For Linux users! If you run it with sudo! And it failed! Don't use sudo! You should not!
For linux users you may need to install python headers
sudo apt-get install python3-dev
You can try it only if it didn't works! In most linux distro! You'll be ok by default!
Last (Trouble shooting doc section)
If needed Check the trouble shooting section here
If you didn't installed first TA-lib native library (as mentioned here and installed python ta-lib first it helps to re-install TA-lib using: pip install --upgrade --force-reinstall TA-lib
i would suggest installing using the wheel from here. Recently i ran across the same problems while trying to upgrade the library which is again another thing you wouldn't want to do.
Hope this helps. Good luck.
I just ran the following command:
pip install -U steem
and the installation worked well until it failed to install pycrypto.
Afterwards I did the
pip install cryptography
command because I thought it was the missing package.
So my question is, how I can install steem without the pycrypto-error (or the pycrypto-package in addition) and how to uninstall the cryptography-Package which I don't need.
(I'm using Windows 7 and Python 3)
Requirement already up-to-date: python-dateutil in c:\users\***\appdata\lo
cal\programs\python\python36\lib\site-packages (from dateparser->maya->steem)
...
Installing collected packages: urllib3, idna, chardet, certifi, requests, pycryp
to, funcy, w3lib, voluptuous, diff-match-patch, scrypt, prettytable, appdirs, la
ngdetect, ruamel.yaml, humanize, tzlocal, regex, dateparser, pytzdata, pendulum,
maya, ecdsa, pylibscrypt, ujson, toolz, steem
Running setup.py install for pycrypto ... error
Complete output from command c:\users\***\appdata\local\programs\pytho
n\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\
***~1\\AppData\\Local\\Temp\\pip-build-k6flhu5k\\pycrypto\\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\***N~1\AppDat
a\Local\Temp\pip-igpkll6u-record\install-record.txt --single-version-externally-
managed --compile:
running install
running build
running build_py
...
building 'Crypto.Random.OSRNG.winrandom' 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\***\appdata\local\programs\python\python36\python.exe -u
-c "import setuptools, tokenize;__file__='C:\\Users\\***N~1\\AppData\\Local\\
Temp\\pip-build-k6flhu5k\\pycrypto\\setup.py';f=getattr(tokenize, 'open', open)(
__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __fil
e__, 'exec'))" install --record C:\Users\***N~1\AppData\Local\Temp\pip-igpkll6
u-record\install-record.txt --single-version-externally-managed --compile" faile
d with error code 1 in C:\Users\***N~1\AppData\Local\Temp\pip-build- k6flhu5k\p
ycrypto\
You need to install Microsoft Visual C++ 14.0 to install pycrypto:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
In the comments you ask which link to use. Use the link to Visual C++ 2015 Build Tools. That will install Visual C++ 14.0 without installing Visual Studio.
Alternate link: https://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.2_standalone:_Build_Tools_for_Visual_Studio_2019_.28x86.2C_x64.2C_ARM.2C_ARM64.29
In the comments you ask about methods of installing pycrypto that do not require installing a compiler. The binaries in the links appear to be for earlier versions of Python than you are using. One link is to a binary in a DropBox account.
I do not recommend downloading binary versions of cryptography libraries provided by third parties. The only way to guarantee that you are getting a version of pycrypto that is compatible with your version of Python and has not been built with any backdoors is to build it from the source.
After you have installed Visual C++, just re-run the original command:
pip install -U steem
To find out what the various install options mean, run this command:
pip help install
The help for the -U option says
-U, --upgrade Upgrade all specified packages to the newest available
version. The handling of dependencies depends on the
upgrade-strategy used.
If you do not already have the steem library installed, you can run the command without the -U option.
If you already have Visual Studio Build Tools installed but you're still getting that error, then you may need to "Modify" your installation to include the Visual C++ build tools.
To do that:
Open up the Visual Studio Installer (you can search for it in the Start Menu if needed).
Find Visual Studio Build Tools and click "Modify":
Add a checkmark to Visual C++ build tools and then click "Modify" in the bottom right to install them:
After the C++ tools finish installing, run the pip command again and it should work.
I got this error when I tried to install pymssql even though Visual C++ 2015 (14.0) is installed in my system.
I resolved this error by downloading the .whl file of pymssql from here.
Once downloaded, it can be installed by the following command :
pip install python_package.whl
Hope this helps
I landed on this question after searching for "Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools". I got this error in Azure DevOps when trying to run pip install to build my own Python package from a source distribution that had C++ extensions. In the end all I had to do was upgrade setuptools before calling pip install:
pip install --upgrade setuptools
So the advice here about updating setuptools when installing from source archives is right after all:). That advice is given here too.
As an alternative to installing Visual C++, there is a way by installing an additional package in Conda (this option doesn't require admin rights). This worked for me:
conda install libpython m2w64-toolchain -c msys2
I faced the same problem. Found the fix here.
Basically just install this.
shasum output:
3e0de8af516c15547602977db939d8c2e44fcc0b visualcppbuildtools_full.exe
md5sum output:
MD5 (visualcppbuildtools_full.exe) = 8d4afd3b226babecaa4effb10d69eb2e
Run your pip installation command again. If everything works fine, its good. Or you might face the following error like me:
Finished generating code
LINK : fatal error LNK1158: cannot run 'rc.exe'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158
Found the fix for the above problem here:
Visual Studio can't build due to rc.exe
That basically says
Add this to your PATH environment variables:
C:\Program Files (x86)\Windows Kits\8.1\bin\x86
Copy these files:
rc.exe
rcdll.dll
From
C:\Program Files (x86)\Windows Kits\8.1\bin\x86
To
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin
It works like a charm
Pycrypto has vulnerabilities assigned the CVE-2013-7459 number, and the repo hasn't accept PRs since June 23, 2014.
Pycryptodome is a drop-in replacement for the PyCrypto library, which exposes almost the same API as the old PyCrypto, see Compatibility with PyCrypto.
If you haven't install pycrypto yet, you can use pip install pycryptodome to install pycryptodome in which you won't get Microsoft Visual C++ 14.0 issue.
Updated link here for download Microsoft Visual C++ 14.0
Download
It works for me without a Visual Studio downloader
On Windows, I strongly recommand installing the latest version of Visual Studio Community. It's free, you will maybe miss some build tools if you only install vc_redist, so you can easily install package by pip instead of wheel, it save lot of time.
Try doing this:
py -m pip install pipwin
py -m pipwin install PyAudio
Three steps I follow for this error:
C++ Build tools are installed
pip install --upgrade setuptools
try using conda to install, conda may have the compiled version which won't need the build tools
None of the solutions proposed by other people here worked for me.
So in my case I had to uinstall ALL older versions
of Microsoft Visual C++ Redistributable from my computer:
Only the newest one (in my case 2015-2022) should be left!
After uinstalling I ran this command:
pip install <your_lib_name>
and everything worked great after that.
Killer solution: install nodejs and tick the option of install chocolatey and other necessary tools... and it will install the tools required to setup a development environment.
I found about scrapy that is a great tool scraping so i tried to install scrapy on my machine, but when i tried to do pip install scrapy it installed for a while and threw me this error..
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
I tried to install it in virtual environment but still the problem persists.
EDIT:
here is what i got after the error..
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 "d:\pycharmprojects\environments\scrapyenv\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\User\\AppData\\Local\\Temp\\pip-build-arbeqlly\\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\User\AppData\Local\Temp\pip-jdj93131-record\install-record.txt --single-version-externally-managed --compile --install-headers d:\pycharmprojects\environments\scrapyenv\include\site\python3.5\Twisted" failed with error code 1 in C:\Users\User\AppData\Local\Temp\pip-build-arbeqlly\Twisted\
any help?
Install Using Conda
If you have conda Use: conda install -c anaconda scrapy
Or
Install Using pip
Download https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted at this location
//Download the whl file of same version as Python version here cp27 means python2.7
pip install Twisted-18.9.0-cp27-cp27m-win_amd64.whl
pip install scrapy
UPDATE
As some one pointed out in the edit, if you download only the vc_redist.x64.exe it's just 15MB, for that go to "other tools and frameworks" and choose MS Visual C++
solved the problem by installing the tools from here
the thing is that some python modules require C++ tools to compile with a python wrapper around, as they are written in C++.
once the setup is downloaded you can select the specific tools or download other facilities provided.
it's somewhere around 4 GB but solves the purpose if in future you need to use some other module which are made in C++.
but the question is what does scrapy has to do with visual studio
Some python modules require a C/C++ compiler to build. That's why you need Visual Studio.
Quoting from Scrapy Installation Guide:
some binary packages that Scrapy depends on (like Twisted, lxml and
pyOpenSSL) require a compiler available to install, and fail if you
don’t have Visual Studio installed.
I have just installed the Visual Studio desktop tools for C++ and solve it.
Install and use anaconda (A Python packages manager) instead of pip.
Download anaconda from here then use:
conda install scrapy
You have to install Python 2.7 then you have to put Python27 and Pyhton27/Scripts on path and install Visual C++ 14 or above and type pip install Scrapy in your cmd.
Installing only the "vc_redist.x64.exe" didn't work for me.
I downloaded Visual Studio 2019 Community here and then chose "C++ desktop developement" and then only the first two boxes (see the following screenshot ont the right):
This worked for me.
Just installed visual studio build tools and the problem get solved. Happy coding!