PyViennaCL installation using pip

160 views Asked by At

I am trying to install PyViennaCL (https://github.com/viennacl/pyviennacl-dev) on Windows 10 64-bit and I am using Python 3.9.6. Using pip install pyviennacl, the error I received at first was that Visual C++ needed is version 14.0 or higher, I solved this issue by downloading vs buildtools. Now, I receive this error in the pip log.

2021-10-13T19:11:20,170 Traceback (most recent call last):
2021-10-13T19:11:20,170   File "C:\Users\...\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_internal\req\req_install.py", line 851, in install
2021-10-13T19:11:20,170     success = install_legacy(
2021-10-13T19:11:20,170   File "C:\Users\...\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_internal\operations\install\legacy.py", line 114, in install
2021-10-13T19:11:20,170     raise LegacyInstallFailure from e
2021-10-13T19:11:20,170 pip._internal.operations.install.legacy.LegacyInstallFailure
2021-10-13T19:11:20,170 
2021-10-13T19:11:20,170 During handling of the above exception, another exception occurred:
2021-10-13T19:11:20,170 
2021-10-13T19:11:20,170 Traceback (most recent call last):
2021-10-13T19:11:20,170   File "C:\Users\...\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_internal\cli\base_command.py", line 164, in exc_logging_wrapper
2021-10-13T19:11:20,170     status = run_func(*args)
2021-10-13T19:11:20,170   File "C:\Users\...\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_internal\cli\req_command.py", line 204, in wrapper
2021-10-13T19:11:20,170     return func(self, options, args)
2021-10-13T19:11:20,170   File "C:\Users\...\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_internal\commands\install.py", line 404, in run
2021-10-13T19:11:20,170     installed = install_given_reqs(
2021-10-13T19:11:20,170   File "C:\Users\...\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_internal\req\__init__.py", line 73, in install_given_reqs
2021-10-13T19:11:20,170     requirement.install(
2021-10-13T19:11:20,170   File "C:\Users\...\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_internal\req\req_install.py", line 869, in install
2021-10-13T19:11:20,170     raise exc.__cause__
2021-10-13T19:11:20,170   File "C:\Users\...\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_internal\operations\install\legacy.py", line 102, in install
2021-10-13T19:11:20,170     runner(
2021-10-13T19:11:20,170   File "C:\Users\...\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_internal\utils\subprocess.py", line 282, in runner
2021-10-13T19:11:20,170     call_subprocess(
2021-10-13T19:11:20,170   File "C:\Users\...\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_internal\utils\subprocess.py", line 254, in call_subprocess
2021-10-13T19:11:20,170     raise InstallationSubprocessError(proc.returncode, command_desc)
2021-10-13T19:11:20,170 pip._internal.exceptions.InstallationSubprocessError: Command errored out with exit status 1: 'C:\Users\...\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-gpf662wg\\pyviennacl_a4fbf7b27c6d4354baba43864f9475fd\\setup.py'"'"'; __file__='"'"'C:\\Users\\...\\AppData\\Local\\Temp\\pip-install-gpf662wg\\pyviennacl_a4fbf7b27c6d4354baba43864f9475fd\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\...\AppData\Local\Temp\pip-record-8qjep_77\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\...\AppData\Local\Programs\Python\Python39\Include\pyviennacl' Check the logs for full command output.
2021-10-13T19:11:20,225 Removed build tracker: 'C:\\Users\\...\\AppData\\Local\\Temp\\pip-req-tracker-3_czkvw8'
1

There are 1 answers

1
meti On BEST ANSWER

There is a website named Unofficial Windows Binaries for Python Extension Packages which collects a variety of useful python libraries in the binary form. If you are going to use the library AS IS (not going to change or develop) I suggest download the proper version of the .whl file (according to windows version, python interpreter version and ...) then install it locally instead of the complex procedure of building binary file. Fortunately, there are several versions of pyviennacl there!

#download proper version 
pip install /path/to/your/downloaded/file.whl