Open guilherber opened 2 years ago
hi, thanks for raising this
the best way to install rvlib is through conda-forge. I'd recommend using the mambaforge distribution of anaconda, then do
conda install rvlib
(if you use the mambaforge distribution you can swap conda
for mamba
which is a faster package manager)
If you want to build from source, you need to use the mingw compiler, not VS
Hi, I'd like to ask the same question: how to install rvlib in Windows using pip not conda?
I am using QGIS and Pysal, which needs to install rvlib. Unforunately, QGIS uses its own Python which does not support conda.
I tried to build from resource use mingw64, but no makefile was found.
I then tried to build using build_lib.py, but python automatically used MSVS rather than mingw64.
Anyone can help with this? Thanks
Try pip install git+https://github.com/QuantEcon/rvlib
Thanks @jcrichard
it still has the error:
Running setup.py install for rvlib ... error error: subprocess-exited-with-error
× Running setup.py install for rvlib did not run successfully. │ exit code: 1 ╰─> [105 lines of output] running install C:\Users\user\AppData\Roaming\Python\Python39\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
...... cl : Command line warning D9002 : ignoring unknown option '-std=c99' ......
error command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe' failed with exit code 2 [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. ╰─> rvlib
Might be due to the python version. Try to install it on python 3.6 on a separated env, which is the version I use.
thanks @jcrichard As I have to use this specific version of Python (3.9.5) that QGIS provided, I may have to figure out how to build rvlib wheel in Windows using MinGW64.. Does anyone know how did Christoph Gohlke sucessfully build the wheel of pysal?
I'm not sure how he did it, but I'm a pysal dev, so I'll offer what help I can. It's probably not too difficult to build a wheel for the pysal metapackage, because as of version 2, the pysal package itself doesnt really contain any source code, just a set of dependencies for each of its specialized analytical libraries (what we call subpackages in pysal). Where you'll run into trouble is when you go to install Gholke's wheel, you likely wont be able to install the pysal segregation package which depends on rvlib.
the issue you're getting here:
......
cl : Command line warning D9002 : ignoring unknown option '-std=c99'
......
happens because the installer is trying to compile rvlib's C modules using the visualstudio compiler. (as you can see, the error is coming from VS):
error command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe' failed with exit code 2
Instead, you need to make sure your system is setup properly to use Mingw. Resources like this might help. You need to make sure that mingw is in your PATH in whatever environment you're using to install rvlib. I don't have a windows machine handy, but I have been able to successfully build from source in a windows VM in the recent past (and our conda recipes on windows build successfully using the mingw toolchain)
another thing you could try is:
thanks @knaaptime
I've tried to add either mingw64 bin or RTools40 mingw54 bin to PATH in OSGeo4W console, but it didn't work. When I pip install rvlib, it always uses MSVC. This happened when it tried to building 'rvlib._rmath_ffi' extension. It is wierd, as the path in OSGeo4W not even has the MSVC folder.
63.3 Running setup.py install for rvlib: started
I got this after finally installed rvlib by pinning it to the github commit:
pip install git+https://github.com/QuantEcon/rvlib.git@6a0b896fdebd86d67bf307f44f59fc3493dcea34
I'm trying to install the rvlib on windows, but im finding some issues, this occur when python is building wheel for rvlib Why im getting this error? Im already installed VS 14.0 How can i fix this "pragma warning" error? I'm also have the VS building tools 2015.