Error when installing psycopg2 on Windows - python

I can't install psycopg2 on Win10 x64 / Python 3.8.
When I run MyProject\venv>pip install psycopg2-binary
I've got 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
But I've already installed BuildTools (from https://visualstudio.microsoft.com/downloads/) and MS Visual C++ redistributable 2015-2019
Also I've tried to install prebuild binaries - https://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg but for any package (win_amd64 or win32) I've got error like "psycopg2-2.8.6-cp39-cp39-win32.whl is not a supported wheel on this platform."
Could you please help - how can I finally install them?

Related

MS Visual studio build tools failing while installing 'gpaw' python package which needs these tools

I want to install gpaw (a DFT calculation python package for physicists), so I used the command -
pip install gpaw
pip installed gpaw's all dependencies except gpaw itself & gave error -
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/
So, I downloaded the latest version & successfully installed visual studio build tools from the link above
But, after I tried to install gpaw using pip again, I got a new error -
cl : Command line warning D9025 : overriding '/DNDEBUG' with '/UNDEBUG'
cl : Command line error D8021 : invalid numeric argument '/Wno-unknown-pragmas'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
Can someone tell me how to fix this failing execution of visual studio build tools?
What I tried to fix - I repaired the installed Visual Studio build tools using installer, but nothing changed.

Can't build Cython code even with correct Visual C++ Build Tools installed

I've been trying to build a basic test file with Cython, but I keep getting 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/.
I have a setup.py file:
from setuptools import setup
from Cython.Build import cythonize
setup(
name='testich',
ext_modules=cythonize("lmao.py"),
)
and I've been attempting to build it both with setup.py build_ext --inplace and cythonize -i lmao.py, but they both yield the same error.
I have tried nefedor's solution, but it hasn't worked for me. I've tried both the latest 2022 build tools and the 2019 build tools for my python version (having only one installed at a time), installing on my C: and D: drives, with no luck. I made sure C++ build tools were checked when installing.
I'm using Python 3.8.10 and Cython 3.0.0a11, and the latest version of setuptools
I was able to get it working by typing the command:
SET DISTUTILS_USE_SDK=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
before building. Both setup.py build_ext --inplace and cythonize -i now work.
You will have to change the vcvarsall path/processor type in the command if your build tools install location/processor type are not the same.
Thanks to https://stackoverflow.com/a/73869315/20203839 and https://learn.microsoft.com/en-us/answers/questions/419525/microsoft-visual-c-140-or-greater-is-required.html for showing me the solution, even though the Microsoft questions page mentions Anaconda it works fine with CPython.

error: Microsoft Visual C++ 14.0 or greater is required during installation of pandas-profiling

As a dependency of the Python module pandas-profiling, an attempt is made to install the module Bottleneck (offers Fast NumPy array functions - but is written in C).
The installation aborts with this error message:
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: Failed building wheel for bottleneck
Failed to build bottleneck
The proposed solution would mean downloading and installing the "Microsoft C ++ Build Tools" from https://visualstudio.microsoft.com/visual-cpp-build-tools/.
However, that would only consume> 6GB hard drive space because I don't use Visual Studio.
Do any of you have an idea for a different solution?
I found a compiled version of the module Bottleneck (Unofficial Windows Binaries for Python Extension Packages.
After the installation as wheel the Python module pandas-profiling could be updated.

Jupyter Notebook installation error - Building wheel for argon2-cffi (PEP 517) ... error

Building wheels for collected packages: argon2-cffi
Building wheel for argon2-cffi (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\prasa\appdata\local\programs\python\python39\python.exe' 'c:\users\prasa\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\prasa\AppData\Local\Temp\tmpcczeigwt'
cwd: C:\Users\prasa\AppData\Local\Temp\pip-install-iele2h25\argon2-cffi
Complete output (17 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\argon2
copying src\argon2\exceptions.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\low_level.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_ffi_build.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_legacy.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_password_hasher.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\_utils.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\__init__.py -> build\lib.win-amd64-3.9\argon2
copying src\argon2\__main__.py -> build\lib.win-amd64-3.9\argon2
running build_clib
building 'argon2' library
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: Failed building wheel for argon2-cffi
Failed to build argon2-cffi
ERROR: Could not build wheels for argon2-cffi which use PEP 517 and cannot be installed directly
I installed python 3.9 on my computer. When I try to install jupyter notebook I got this error. SO how to solve this issue ?
In case of mac user on Intel CPUs, just check your pip version, if you are installing through the command :
pip install notebook
Upgrade your PIP, the command that worked for me:
/Library/Developer/CommandLineTools/usr/bin/python3 -m pip install --upgrade pip
Check if its the latest version of PIP , by using command :
pip --version
After this again, try :
pip install notebook
This time you should not see any error.
Then include ~/Library/Python/3.8/bin in your path variable.
Check if its there by :
echo $PATH
And then launch the jupyter notebook by command :
jupyter notebook
Pls upvote, if you found this answer useful :)
I had the exact same issue as you. This is how I solved it.
I found the answer here: https://discuss.codecademy.com/t/having-trouble-installing-jupyter-notebooks/537292/2
You can use the link and follow the instructions if you'd like. I'll also tell you how to do it here.
It's an easy fix. The error is about the Microsoft Visual C++ being out of date. In the error it gives you the link for the update.
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/
Go to https://visualstudio.microsoft.com/visual-cpp-build-tools/ and click 'Download Build Tools' and install it.
Once it's installed, you'll see a few choices. Select 'C++ build tools' and install it. Restart your computer after it's done. Then run pip install jupyter and you should be good!
I had this problem on python 3.7.5 when I called
pip install jupyter
The solution was to first call
pip install argon2-cffi==20.1.0
And then call
pip install jupyter
I think the error is present in the newest version of argon2-cffi. Which is 21.1.0 https://pypi.org/project/argon2-cffi/21.1.0/#history
As the error indicates you need to download Microsoft Visual C++ 14.0 or greater.
In case if other people have problem and in their case that will work.
In my case I used:
py -3.8 -m pip install pyautogui
That gave me respond:
Python 3.8 not found!
Installed Pythons found by C:\Windows\py.exe Launcher for Windows
-3.9-64 *
-3.7-64
So after I installed Python 3.8 once again used:
py -3.8 -m pip install pyautogui
Result:
Successfully installed PyTweening-1.0.3 mouseinfo-0.1.3 pyautogui-0.9.52 pygetwindow-0.0.9 pymsgbox-1.0.9 pyperclip-1.8.1 pyrect-0.1.4 pyscreeze-0.
argon2-cffi is now shipping Python 3.9 wheels for Windows which should resolve your installation problem.
P.S. The wheel is added now
Microsoft Visual C++ 14.2 standalone: Build Tools for Visual Studio 2019 (x86, x64, ARM, ARM64)
This is a standalone version of Visual C++ 14.2 compiler, you don't need to install Visual Studio 2019.
Install Microsoft Build Tools for Visual Studio 2019.
In Build tools, install C++ build tools and ensure the latest
versions of MSVCv142 - VS 2019 C++ x64/x86 build tools and Windows 10
SDK are checked.
The setuptools Python package version must be at least 34.4.0.
Build Tools also allows us to install any previous Visual C++ 14 version (Including 2015, 2017 ones).
Source
1.11 GB Download size; Space 4.4 GB

error: Microsoft Visual C++ 10.0 is required while installing Pandas

While trying to install Pandas and sasl modules in Windows via pip, I am getting below error.
error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279
I have tried to install Microsoft Visual C++ 10.0 but getting the same error. My Python version is 3.4.0 and pip version is 18.1
C:\Users\ishan\PycharmProjects\python-Simple\venv\Scripts>python --version
Python 3.4.0
C:\Users\ishan\PycharmProjects\python-Simple\venv\Scripts>pip --version
pip 18.1 from c:\users\ishan\pycharmprojects\python-simple\venv\lib\site-
packages\pip (python 3.4)

Categories

Resources