pgcli
pgcli copied to clipboard
error: Microsoft Visual C++ 14.0 is required.
Description
I tried to install pgcli on win7, but got the err: error: Microsoft Visual C++ 14.0 is required.
Your environment
Windows 7, Python 3.8.1
running build
running build_ext \n
building 'setproctitle' extension \n
error: Microsoft Visual C++ 14.0 is required.
I think the problem is occued by the additional dependencies named setproctitle.
In the source code setup.py :
# setproctitle is used to mask the password when running `ps` in command line.
# But this is not necessary in Windows since the password is never shown in the
# task manager. Also setproctitle is a hard dependency to install in Windows,
# so we'll only install it if we're not in Windows.
if platform.system() != "Windows" and not platform.system().startswith("CYGWIN"):
install_requirements.append("setproctitle >= 1.1.9")
The comments means that setproctitle is not necessary in Windows. And it's so hard
to install setproctitle in windows.
The check is for skipping the windows, but virtually not work:
if platform.system() != "Windows" and not platform.system().startswith("CYGWIN"):
Solution
When you have the same problem, there are two ways which works:
- you can install the dependencies individually, like this:
pip install pgcli --no-deps
pip install pgspecial
pip install prompt_toolkit
...
- you can modify the
setup.pyand install from source code.