msangnier / qreg

Data sparse and non-parametric quantile regression
10 stars 4 forks source link

Installation Error #10

Open jpca227 opened 2 years ago

jpca227 commented 2 years ago

I am attempting to install via the following commands:

pip install https://github.com/msangnier/qreg/archive/master.zip

With the following error:

Building wheels for collected packages: qreg Building wheel for qreg (setup.py): started Building wheel for qreg (setup.py): finished with status 'error' Running setup.py clean for qreg Failed to build qreg Installing collected packages: qreg Running setup.py install for qreg: started Running setup.py install for qreg: finished with status 'error' Note: you may need to restart the kernel to use updated packages. ERROR: Command errored out with exit status 1: command: 'C:\Users\james\anaconda3\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\james\AppData\Local\Temp\pip-req-build-eaupasi2\setup.py'"'"'; file='"'"'C:\Users\james\AppData\Local\Temp\pip-req-build-eaupasi2\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'"'"'))' bdist_wheel -d 'C:\Users\james\AppData\Local\Temp\pip-wheel-xm2m5_r4' cwd: C:\Users\james\AppData\Local\Temp\pip-req-build-eaupasi2\

msangnier commented 2 years ago

Hello, you may try with conda instead of pip.

jpca227 commented 2 years ago

Thank you for the recommendation! The result is as follows:

conda install https://github.com/msangnier/qreg/archive/master.zip Collecting package metadata (current_repodata.json): ...working... done Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve. Collecting package metadata (repodata.json): ...working... done Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.

Note: you may need to restart the kernel to use updated packages.

PackagesNotFoundError: The following packages are not available from current channels:

Current channels:

To search for alternate channels that may provide the conda package you're looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

msangnier commented 2 years ago

Try to install pip in conda and use pip directly:

conda install git pip

pip install https://github.com/msangnier/qreg/archive/master.zip

jpca227 commented 2 years ago

Hello...I am trying to run these commands from the IPython console in Spyder with following errors:

pip install https://github.com/msangnier/qreg/archive/master.zip Collecting https://github.com/msangnier/qreg/archive/master.zip Using cached https://github.com/msangnier/qreg/archive/master.zip Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: numpy in c:\users\james\anaconda3\lib\site-packages (from qreg==0.1) (1.21.5) Requirement already satisfied: cvxopt in c:\users\james\anaconda3\lib\site-packages (from qreg==0.1) (1.3.0) Building wheels for collected packages: qreg Building wheel for qreg (setup.py): started Building wheel for qreg (setup.py): finished with status 'error' Running setup.py clean for qreg Failed to build qreg Installing collected packages: qreg Running setup.py install for qreg: started Running setup.py install for qreg: finished with status 'error' Note: you may need to restart the kernel to use updated packages. error: subprocess-exited-with-error

python setup.py bdist_wheel did not run successfully. exit code: 1

[31 lines of output] C:\Users\james\AppData\Local\Temp\pip-req-build-ncjdrqfn\qreg/ Appending qreg configuration to Ignoring attempt to set 'name' (from '' to 'qreg') running bdist_wheel running build running config_cc unifing config_cc, config, build_clib, build_ext, build commands --compiler options running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src build_src building extension "qreg.dataset_fast" sources building extension "qreg.sdca_qr_fast" sources building extension "qreg.sdca_qr_al_fast" sources build_src: building npy-pkg config files C:\Users\james\anaconda3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build_py creating build creating build\lib.win-amd64-cpython-39 creating build\lib.win-amd64-cpython-39\qreg copying qreg\qreg.py -> build\lib.win-amd64-cpython-39\qreg copying qreg\setup.py -> build\lib.win-amd64-cpython-39\qreg copying qreg__init__.py -> build\lib.win-amd64-cpython-39\qreg running build_ext No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils customize MSVCCompiler customize MSVCCompiler using build_ext CCompilerOpt.cc_test_flags[1013] : testing flags (/O2) 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/ CCompilerOpt.cache_flush[809] : write cache to path -> C:\Users\james\AppData\Local\Temp\pip-req-build-ncjdrqfn\build\temp.win-amd64-cpython-39\Release\ccompiler_opt_cache_ext.py [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for qreg error: subprocess-exited-with-error

Running setup.py install for qreg did not run successfully. exit code: 1

[31 lines of output] C:\Users\james\AppData\Local\Temp\pip-req-build-ncjdrqfn\qreg/ Appending qreg configuration to Ignoring attempt to set 'name' (from '' to 'qreg') running install C:\Users\james\anaconda3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running config_cc unifing config_cc, config, build_clib, build_ext, build commands --compiler options running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src build_src building extension "qreg.dataset_fast" sources building extension "qreg.sdca_qr_fast" sources building extension "qreg.sdca_qr_al_fast" sources build_src: building npy-pkg config files running build_py creating build creating build\lib.win-amd64-cpython-39 creating build\lib.win-amd64-cpython-39\qreg copying qreg\qreg.py -> build\lib.win-amd64-cpython-39\qreg copying qreg\setup.py -> build\lib.win-amd64-cpython-39\qreg copying qreg__init__.py -> build\lib.win-amd64-cpython-39\qreg running build_ext No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils customize MSVCCompiler customize MSVCCompiler using build_ext CCompilerOpt.cc_test_flags[1013] : testing flags (/O2) 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/ CCompilerOpt.cache_flush[809] : write cache to path -> C:\Users\james\AppData\Local\Temp\pip-req-build-ncjdrqfn\build\temp.win-amd64-cpython-39\Release\ccompiler_opt_cache_ext.py [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.

qreg

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

msangnier commented 2 years ago

It seems your error is "error: Microsoft Visual C++ 14.0 or greater is required".

If compilation does not work, you can just extract the files, add the path to sys.path, and use alg='qp' instead of alg='sdca'. Compilation is only for the C++ implementation of sdca. The solver qp is based on cvxopt.