pip install python-pkcs11 Error: Microsoft Visual C++ 14.0 or greater is required

So, I know this question is asked quite a lot in here, but I executed the pip install python-pkcs11 and pip threw this 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/

And even though I’ve tried almost every single solution in here, here, here and here, I am still stuck in this problem. Honestly, I am getting desperate because none of it worked and I don’t know what to do anymore. So, if anyone can help me I’ll be really grateful.

Here’s the complete error pip install log:

> PS C:UsersAYRTO> pip install python-pkcs11 Collecting python-pkcs11 
> Using cached python-pkcs11-0.7.0.tar.gz (106 kB)   Preparing metadata
> (setup.py) ... done Requirement already satisfied: asn1crypto in
> c:usersayrtoappdatalocalpackagespythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0localcachelocal-packagespython310site-packages
> (from python-pkcs11) (1.5.1) Requirement already satisfied:
> cached-property in
> c:usersayrtoappdatalocalpackagespythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0localcachelocal-packagespython310site-packages
> (from python-pkcs11) (1.5.2) Building wheels for collected packages:
> python-pkcs11   Building wheel for python-pkcs11 (setup.py) ... error 
> error: subprocess-exited-with-error
> 
>   × python setup.py bdist_wheel did not run successfully.   │ exit
> code: 1   ╰─> [52 lines of output]
>       C:UsersAYRTOAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagessetuptoolsinstaller.py:27:
> SetuptoolsDeprecationWarning: setuptools.installer is deprecated.
> Requirements should be satisfied by a PEP 517 installer.
>         warnings.warn(
>       running bdist_wheel
>       running build
>       running build_py
>       creating build
>       creating buildlib.win-amd64-cpython-310
>       creating buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11constants.py -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11defaults.py -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11exceptions.py -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11mechanisms.py -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11types.py -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11__init__.py -> buildlib.win-amd64-cpython-310pkcs11
>       creating buildlib.win-amd64-cpython-310pkcs11util
>       copying pkcs11utildh.py -> buildlib.win-amd64-cpython-310pkcs11util
>       copying pkcs11utildsa.py -> buildlib.win-amd64-cpython-310pkcs11util
>       copying pkcs11utilec.py -> buildlib.win-amd64-cpython-310pkcs11util
>       copying pkcs11utilrsa.py -> buildlib.win-amd64-cpython-310pkcs11util
>       copying pkcs11utilx509.py -> buildlib.win-amd64-cpython-310pkcs11util
>       copying pkcs11util__init__.py -> buildlib.win-amd64-cpython-310pkcs11util
>       running egg_info
>       writing python_pkcs11.egg-infoPKG-INFO
>       writing dependency_links to python_pkcs11.egg-infodependency_links.txt
>       writing requirements to python_pkcs11.egg-inforequires.txt
>       writing top-level names to python_pkcs11.egg-infotop_level.txt
>       listing git files failed - pretending there aren't any
>       reading manifest file 'python_pkcs11.egg-infoSOURCES.txt'
>       writing manifest file 'python_pkcs11.egg-infoSOURCES.txt'
>       copying pkcs11_errors.pyx -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11_mswin.pxd -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11_pkcs11.pyx -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11_pkcs11_defn.pxd -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11_utils.pyx -> buildlib.win-amd64-cpython-310pkcs11
>       running build_ext
>       cythoning pkcs11/_pkcs11.pyx to pkcs11_pkcs11.c
>       warning: pkcs11_pkcs11.pyx:219:70: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:590:63: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:616:51: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:656:64: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:903:56: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:947:74: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:957:67: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:994:55: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:1038:74: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:1048:67: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:1084:52: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:1125:65: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:1217:59: Use boundscheck(False) for faster access
>       warning: pkcs11_pkcs11.pyx:1478:64: Use boundscheck(False) for faster access
>       building 'pkcs11._pkcs11' extension
>       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/
>       [end of output]
> 
>   note: This error originates from a subprocess, and is likely not a
> problem with pip.   ERROR: Failed building wheel for python-pkcs11  
> Running setup.py clean for python-pkcs11 Failed to build python-pkcs11
> Installing collected packages: python-pkcs11   Running setup.py
> install for python-pkcs11 ... error   error:
> subprocess-exited-with-error
> 
>   × Running setup.py install for python-pkcs11 did not run
> successfully.   │ exit code: 1   ╰─> [40 lines of output]
>       C:UsersAYRTOAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagessetuptoolsinstaller.py:27:
> SetuptoolsDeprecationWarning: setuptools.installer is deprecated.
> Requirements should be satisfied by a PEP 517 installer.
>         warnings.warn(
>       running install
>       C:UsersAYRTOAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packagessetuptoolscommandinstall.py:34:
> SetuptoolsDeprecationWarning: setup.py install is deprecated. Use
> build and pip and other standards-based tools.
>         warnings.warn(
>       running build
>       running build_py
>       creating build
>       creating buildlib.win-amd64-cpython-310
>       creating buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11constants.py -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11defaults.py -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11exceptions.py -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11mechanisms.py -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11types.py -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11__init__.py -> buildlib.win-amd64-cpython-310pkcs11
>       creating buildlib.win-amd64-cpython-310pkcs11util
>       copying pkcs11utildh.py -> buildlib.win-amd64-cpython-310pkcs11util
>       copying pkcs11utildsa.py -> buildlib.win-amd64-cpython-310pkcs11util
>       copying pkcs11utilec.py -> buildlib.win-amd64-cpython-310pkcs11util
>       copying pkcs11utilrsa.py -> buildlib.win-amd64-cpython-310pkcs11util
>       copying pkcs11utilx509.py -> buildlib.win-amd64-cpython-310pkcs11util
>       copying pkcs11util__init__.py -> buildlib.win-amd64-cpython-310pkcs11util
>       running egg_info
>       writing python_pkcs11.egg-infoPKG-INFO
>       writing dependency_links to python_pkcs11.egg-infodependency_links.txt
>       writing requirements to python_pkcs11.egg-inforequires.txt
>       writing top-level names to python_pkcs11.egg-infotop_level.txt
>       listing git files failed - pretending there aren't any
>       reading manifest file 'python_pkcs11.egg-infoSOURCES.txt'
>       writing manifest file 'python_pkcs11.egg-infoSOURCES.txt'
>       copying pkcs11_errors.pyx -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11_mswin.pxd -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11_pkcs11.pyx -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11_pkcs11_defn.pxd -> buildlib.win-amd64-cpython-310pkcs11
>       copying pkcs11_utils.pyx -> buildlib.win-amd64-cpython-310pkcs11
>       running build_ext
>       skipping 'pkcs11_pkcs11.c' Cython extension (up-to-date)
>       building 'pkcs11._pkcs11' extension
>       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/
>       [end of output]
> 
>   note: This error originates from a subprocess, and is likely not a
> problem with pip. error: legacy-install-failure
> 
> × Encountered error while trying to install package. ╰─> python-pkcs11
> 
> note: This is an issue with the package mentioned above, not pip.
> hint: See above for output from the failure.

Leave a Comment