pgcli icon indicating copy to clipboard operation
pgcli copied to clipboard

error: Microsoft Visual C++ 14.0 is required.

Open steven-ysj opened this issue 5 years ago • 0 comments

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:

  1. you can install the dependencies individually, like this:
pip install pgcli --no-deps
pip install pgspecial
pip install prompt_toolkit
...
  1. you can modify the setup.py and install from source code.

steven-ysj avatar May 01 '20 02:05 steven-ysj