Closed ghost closed 1 year ago
It looks like jaxlib
may not be available for Python 3.10.4
? Could you try pip install jaxlib
?
Thanks. When I try pip install jaxlib
I get the following error:
ERROR: Could not find a version that satisfies the requirement jaxlab (from versions: none)
ERROR: No matching distribution found for jaxlab
I was able to use this link here to install jax https://www.reddit.com/r/learnmachinelearning/comments/qnqdy0/jax_on_windows/
However, after having installed it and running pip install riskparityportfolio
I unfortunately received another error:
check.warn(importable)
copying riskparityportfolio\vanilla.cpp -> build\lib.win-amd64-cpython-310\riskparityportfolio
creating build\lib.win-amd64-cpython-310\riskparityportfolio\tests
copying riskparityportfolio\tests\__init__.py -> build\lib.win-amd64-cpython-310\riskparityportfolio\tests
copying riskparityportfolio\tests\test_modern_rpp.py -> build\lib.win-amd64-cpython-310\riskparityportfolio\tests
copying riskparityportfolio\tests\test_vanilla_rpp.py -> build\lib.win-amd64-cpython-310\riskparityportfolio\tests
running build_ext
building 'riskparityportfolio.vanilla' extension
creating build\temp.win-amd64-cpython-310
creating build\temp.win-amd64-cpython-310\Release
creating build\temp.win-amd64-cpython-310\Release\riskparityportfolio
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ithird-party\eigen_3.3.7 -IC:\Users\me\anaconda3\envs\rpjax\lib\site-packages\pybind11\include -IC:\Users\me\anaconda3\envs\rpjax\lib\site-packages\pybind11\include -IC:\Users\me\anaconda3\envs\rpjax\include -IC:\Users\me\anaconda3\envs\rpjax\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /EHsc /Tpriskparityportfolio/vanilla.cpp /Fobuild\temp.win-amd64-cpython-310\Release\riskparityportfolio/vanilla.obj /EHsc /DVERSION_INFO=\\\"0.3\\\"
vanilla.cpp
riskparityportfolio/vanilla.cpp(21): warning C4244: 'initializing': conversion from 'Eigen::EigenBase<Derived>::Index' to 'unsigned int', possible loss of data
with
[
Derived=Eigen::Matrix<double,-1,1,0,-1,1>
]
riskparityportfolio/vanilla.cpp(21): warning C4244: 'initializing': conversion from 'Eigen::EigenBase<Derived>::Index' to 'const unsigned int', possible loss of data
with
[
Derived=Eigen::Matrix<double,-1,1,0,-1,1>
]
riskparityportfolio/vanilla.cpp(50): warning C4244: 'initializing': conversion from 'Eigen::EigenBase<Derived>::Index' to 'unsigned int', possible loss of data
with
[
Derived=Eigen::Matrix<double,-1,1,0,-1,1>
]
riskparityportfolio/vanilla.cpp(50): warning C4244: 'initializing': conversion from 'Eigen::EigenBase<Derived>::Index' to 'const unsigned int', possible loss of data
with
[
Derived=Eigen::Matrix<double,-1,1,0,-1,1>
]
riskparityportfolio/vanilla.cpp(166): error C2017: illegal escape sequence
riskparityportfolio/vanilla.cpp(166): error C2001: newline in constant
riskparityportfolio/vanilla.cpp(170): error C2143: syntax error: missing ';' before '}'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\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.
╰─> riskparityportfolio
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Any advice on solving this? I suspect it is an error in the underlying C++ code in lines 166 & 167 of riskparityportfolio/vanilla.cpp, but I don't know enough C++ to handle it.
I had a fresh install of VS Build Tools today and also tried reinstalling this and restarting but alas to no avail.
@TheBounceBack would you mind sharing the output of:
import pybind11 as pb
import jaxlib
import jax
print((pb.__version__, jax.__version__, jaxlib.__version__))
Sure, I get:
>>> print((pb.__version__, jax.__version__, jaxlib.__version__))
('2.10.0', '0.2.22', '0.3.7')
hm, i see. would you mind try installing the development version?
git clone https://github.com/dppalomar/riskparity.py.git
cd riskparity.py
pip install -e .
PS: i'd love to be able to run CI on windows, but it seems jax is not yet officially supported on it.
Thanks. Unfortunately I seem to get the same error!
riskparityportfolio/vanilla.cpp(167): error C2017: illegal escape sequence
riskparityportfolio/vanilla.cpp(167): error C2001: newline in constant
riskparityportfolio/vanilla.cpp(171): error C2143: syntax error: missing ';' before '}'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\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 C2143: syntax error: missing ';' before '}'
could you add a ";" after line 171 in vanilla.cpp
and try again installing the dev version? maybe this is a windows thing because i can't reproduce your error on macos or ubuntu.
@TheBounceBack okay, i've pushed some changes to master
that hopefully fixed this issue. could you try again:
git clone https://github.com/dppalomar/riskparity.py.git
cd riskparity.py
pip install -e .
I just tried again and this time a slightly different error. I think it might be something to do with Windows / linux line endings or spacing.
vanilla.cpp
riskparityportfolio/vanilla.cpp(170): error C2017: illegal escape sequence
riskparityportfolio/vanilla.cpp(170): error C2001: newline in constant
riskparityportfolio/vanilla.cpp(174): error C2143: syntax error: missing ';' before '}'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.33.31629\\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.
has the installation problem,win10,python 3.9
ERROR: Command errored out with exit status 1: 'C:\myprogram\Anaconda37\envs\py39\python.exe' -u -c 'import io, os, sys,
riskparityportfolio v0.4
now builds on windows. Thank you all for the discussions.
Hi, I am trying to install riskparityportfolio using 'pip install riskparityportfolio'. I have installed Visual Studio Build Tools 2022. I am using python 3.10.4 and operating on Windows.
The error I received is:
Do you have any advice on how to fix this and successfully install your great riskparityportfolio package?
Thank you