Repository navigation
Closed
Labels
maintenanceContinuous integration, unit testing & package distribution
Description
Operating system, environment, python version
Windows 10, anaconda, python3.8.5
What you tried
pip install pyportfolioopt
Error message
ERROR: Command errored out with exit status 1: 'C:\Users\guna3\anaconda3\python.exe' 'C:\Users\guna3\anaconda3\lib\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\guna3\AppData\Local\Temp\tmptl_ro7gy' Check the logs for full command output.
Copy paste the terminal message here
Preparing wheel metadata ... - ** On entry to DGEBAL parameter number 3 had an illegal value
** On entry to DGEHRD parameter number 2 had an illegal value
** On entry to DORGHR DORGQR parameter number 2 had an illegal value
** On entry to DHSEQR parameter number 4 had an illegal value
error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\guna3\anaconda3\python.exe' 'C:\Users\guna3\anaconda3\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\guna3\AppData\Local\Temp\tmptl_ro7gy'
cwd: C:\Users\guna3\AppData\Local\Temp\pip-install-0h6jf_hf\cvxpy
Complete output (55 lines):
running dist_info
creating C:\Users\guna3\AppData\Local\Temp\pip-modern-metadata-b15pkg6e\cvxpy.egg-info
writing C:\Users\guna3\AppData\Local\Temp\pip-modern-metadata-b15pkg6e\cvxpy.egg-info\PKG-INFO
writing dependency_links to C:\Users\guna3\AppData\Local\Temp\pip-modern-metadata-b15pkg6e\cvxpy.egg-info\dependency_links.txt
writing requirements to C:\Users\guna3\AppData\Local\Temp\pip-modern-metadata-b15pkg6e\cvxpy.egg-info\requires.txt
writing top-level names to C:\Users\guna3\AppData\Local\Temp\pip-modern-metadata-b15pkg6e\cvxpy.egg-info\top_level.txt
writing manifest file 'C:\Users\guna3\AppData\Local\Temp\pip-modern-metadata-b15pkg6e\cvxpy.egg-info\SOURCES.txt'
Traceback (most recent call last):
File "C:\Users\guna3\anaconda3\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
main()
File "C:\Users\guna3\anaconda3\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\guna3\anaconda3\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 133, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "C:\Users\guna3\AppData\Local\Temp\pip-build-env-axm357oe\overlay\Lib\site-packages\setuptools\build_meta.py", line 161, in prepare_metadata_for_build_wheel
self.run_setup()
File "C:\Users\guna3\AppData\Local\Temp\pip-build-env-axm357oe\overlay\Lib\site-packages\setuptools\build_meta.py", line 253, in run_setup
super(_BuildMetaLegacyBackend,
File "C:\Users\guna3\AppData\Local\Temp\pip-build-env-axm357oe\overlay\Lib\site-packages\setuptools\build_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 57, in <module>
setup(
File "C:\Users\guna3\AppData\Local\Temp\pip-build-env-axm357oe\overlay\Lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\guna3\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\guna3\anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\guna3\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\guna3\AppData\Local\Temp\pip-build-env-axm357oe\overlay\Lib\site-packages\setuptools\command\dist_info.py", line 31, in run
egg_info.run()
File "C:\Users\guna3\AppData\Local\Temp\pip-build-env-axm357oe\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 298, in run
self.find_sources()
File "C:\Users\guna3\AppData\Local\Temp\pip-build-env-axm357oe\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 305, in find_sources
mm.run()
File "C:\Users\guna3\AppData\Local\Temp\pip-build-env-axm357oe\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 536, in run
self.add_defaults()
File "C:\Users\guna3\AppData\Local\Temp\pip-build-env-axm357oe\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 572, in add_defaults
sdist.add_defaults(self)
File "C:\Users\guna3\anaconda3\lib\distutils\command\sdist.py", line 228, in add_defaults
self._add_defaults_ext()
File "C:\Users\guna3\anaconda3\lib\distutils\command\sdist.py", line 311, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "C:\Users\guna3\anaconda3\lib\distutils\cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "C:\Users\guna3\anaconda3\lib\distutils\cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "setup.py", line 23, in finalize_options
import numpy
File "C:\Users\guna3\AppData\Local\Temp\pip-build-env-axm357oe\overlay\Lib\site-packages\numpy\__init__.py", line 305, in <module>
_win_os_check()
File "C:\Users\guna3\AppData\Local\Temp\pip-build-env-axm357oe\overlay\Lib\site-packages\numpy\__init__.py", line 302, in _win_os_check
raise RuntimeError(msg.format(__file__)) from None
RuntimeError: The current Numpy installation ('C:\\Users\\guna3\\AppData\\Local\\Temp\\pip-build-env-axm357oe\\overlay\\Lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: https://tinyurl.com/y3dm3h86

Metadata
Metadata
Assignees
Labels
maintenanceContinuous integration, unit testing & package distribution
Activity
bvrilliance commentedon Nov 27, 2020
Do you have C++ installed?
gunavanthmahendra commentedon Nov 28, 2020
Yes I have C++ installed I followed the instructions correctly
x829901 commentedon Nov 29, 2020
x829901 commentedon Nov 29, 2020
Could it be that there is a bug in the Visual Studio 2019 concerning numpy and scipy? Apparently, the workaround is to
and
https://developercommunity.visualstudio.com/content/problem/1207405/fmod-after-an-update-to-windows-2004-is-causing-a.html
However, after doing this, when I try to
To a new environment with Python 3.8.5, I get the same error as above. This started as soon as I switched to a new computer and tried to install all my usual packages to a new environment. This is a HUGE problem as I use this for work.
x829901 commentedon Nov 30, 2020
Duplicate of #223
This workaround solution worked for me. Created new environment with
conda create -n myenv python=3.6 numpy=1.19.3Hopefully Microsoft fixes the fmod bug soon.robertmartin8 commentedon Nov 30, 2020
Sorry I can't be of assistance here as I'm on macOS. It sounds like some thorny issue related to C++ interacting with some python libraries. Glad you have a workaround!
x829901 commentedon Dec 20, 2020
I suggest keeping this issue open until PyPortfolioOpt becomes compatible with python 3.7<= and numpy 1.19.3<= with the following as an update.
I wanted to update everyone on my work dealing with this issue. Here is an update from Microsoft's developer team regarding their upcoming fix to one of their Windows updates breaking numpy==1.19.4 on python 3.8, thereby making PyPortfolioOpt impossible to
pip install PyPortfolioOpton python 3.8 on Windows 10. They estimate a fix coming out at the end of January but you can test the fix. Below I post the message from the Senior Software Engineer. https://tinyurl.com/y3dm3h86.I've been using the current workaround python==3.6 with numpy==1.19.3 solution for a few weeks now and frankly, it's not satisfactory. Python 3.6 and compatible packages have bugs and issues that have since been resolved in subsequent updated versions Python 3.7 and currently Python 3.8 with compatible packages. I've found myself encountering these bugs and having to manually fix them by searching for solutions and having to edit code in various dependencies where I encounter these bugs. Everything was working great before Microsoft broke numpy, so all I can really do is wait for them to come out with the update and keep using an inferior version of Python and compatible dependencies.
robertmartin8 commentedon Dec 24, 2020
@x829901 Appreciate the analysis – will keep this issue open until resolved!
Is there anything I can do on my end to fix this? In the
requirements.txt, I havenumpy>=1.17so in principle PyPortfolioOpt should be compatible withpython 3.7<= numpy 1.19.3<=?NabilChouaib commentedon Feb 14, 2021
Found a workaround. Instead of:
pip install PyPortfolioOpt
I installed dependencies manually then used:
pip install --no-dependencies PyPortfolioOpt
yordan-bankov commentedon Feb 16, 2021
robertmartin8 commentedon Feb 16, 2021
@yordan-bankov just to clarify, is it working now?
yordan-bankov commentedon Feb 16, 2021
Yes PyPortfolioOpt works, but:
RuntimeError: "module compiled against API version 0xe but this version of numpy is 0xd"
So now functions from PyPortfolioOpt are OK, but I assume if I try to use something from TensorFlow, it will not work.
This below is relevant for Windows / Anaconda only:
The Anaconda is an additional level of abstraction above Python. In this respect Anaconda provides a set of modules which are maintained by conda. For example, Anaconda for Windows have numpy 1.19.0 in the Anaconda modules list. To have working PyPortfolioOpt it is required to have numpy 1.20.1. This numpy is not supported by Anaconda set of modules. The numpy 1.20.1 can be installed using pip, and this will make PyPortfolioOpt working. On the other hand, other modules will also need manual update using pip.
StephenKwokChina commentedon Nov 21, 2021
dear all, the problem is not from PyPortfolioOpt, It's from installing the dependecy cvxpy, before installing cvxpy you need install numpy+mkl not numpy.
Here is the solution:
NumPy+mkl: https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
SCIPY: https://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
CVXOPT: https://www.lfd.uci.edu/~gohlke/pythonlibs/#cvxopt
SCS: https://www.lfd.uci.edu/~gohlke/pythonlibs/#scs
ECOS: https://www.lfd.uci.edu/~gohlke/pythonlibs/#ecos
OSQP: https://www.lfd.uci.edu/~gohlke/pythonlibs/#osqp
CVXcanon: https://www.lfd.uci.edu/~gohlke/pythonlibs/#cvxcanon
Fastcache: https://www.lfd.uci.edu/~gohlke/pythonlibs/#fastcache
Multiprocess: https://www.lfd.uci.edu/~gohlke/pythonlibs/#multiprocess
CVXPY:https://www.lfd.uci.edu/~gohlke/pythonlibs/#cvxpy
remember install the wheel one by one and following the order please.