Skip to content

Could not install on Windows Anaconda - Jupyter Notebook Python 3.7 #223

Closed

Description

@buya7

ERROR: Command errored out with exit status 1:
command: 'C:\Users\Admin\anaconda3\python.exe' 'C:\Users\Admin\anaconda3\lib\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\Public\Documents\Wondershare\CreatorTemp\tmpx_5j19l6'
cwd: C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-epnttnfe\cvxpy
Complete output (55 lines):
running dist_info
creating C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-modern-metadata-mf4pu3yb\cvxpy.egg-info
writing C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-modern-metadata-mf4pu3yb\cvxpy.egg-info\PKG-INFO
writing dependency_links to C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-modern-metadata-mf4pu3yb\cvxpy.egg-info\dependency_links.txt
writing requirements to C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-modern-metadata-mf4pu3yb\cvxpy.egg-info\requires.txt
writing top-level names to C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-modern-metadata-mf4pu3yb\cvxpy.egg-info\top_level.txt
writing manifest file 'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-modern-metadata-mf4pu3yb\cvxpy.egg-info\SOURCES.txt'
Traceback (most recent call last):
File "C:\Users\Admin\anaconda3\lib\site-packages\pip_vendor\pep517_in_process.py", line 280, in
main()
File "C:\Users\Admin\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\Admin\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\Public\Documents\Wondershare\CreatorTemp\pip-build-env-1qyn7fx2\overlay\Lib\site-packages\setuptools\build_meta.py", line 161, in prepare_metadata_for_build_wheel
self.run_setup()
File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-build-env-1qyn7fx2\overlay\Lib\site-packages\setuptools\build_meta.py", line 253, in run_setup
super(BuildMetaLegacyBackend,
File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-build-env-1qyn7fx2\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
setup(
File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-build-env-1qyn7fx2\overlay\Lib\site-packages\setuptools_init
.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Admin\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Admin\anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\Admin\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-build-env-1qyn7fx2\overlay\Lib\site-packages\setuptools\command\dist_info.py", line 31, in run
egg_info.run()
File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-build-env-1qyn7fx2\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 298, in run
self.find_sources()
File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-build-env-1qyn7fx2\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 305, in find_sources
mm.run()
File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-build-env-1qyn7fx2\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 536, in run
self.add_defaults()
File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-build-env-1qyn7fx2\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 572, in add_defaults
sdist.add_defaults(self)
File "C:\Users\Admin\anaconda3\lib\distutils\command\sdist.py", line 228, in add_defaults
self._add_defaults_ext()
File "C:\Users\Admin\anaconda3\lib\distutils\command\sdist.py", line 311, in add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "C:\Users\Admin\anaconda3\lib\distutils\cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "C:\Users\Admin\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\Public\Documents\Wondershare\CreatorTemp\pip-build-env-1qyn7fx2\overlay\Lib\site-packages\numpy_init
.py", line 305, in
win_os_check()
File "C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-build-env-1qyn7fx2\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\Public\Documents\Wondershare\CreatorTemp\pip-build-env-1qyn7fx2\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
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Admin\anaconda3\python.exe' 'C:\Users\Admin\anaconda3\lib\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\Public\Documents\Wondershare\CreatorTemp\tmpx_5j19l6' Check the logs for full command output.

Activity

  1. added
    maintenance
    on Nov 17, 2020
  2. robertmartin8 commented on Nov 19, 2020

    @robertmartin8
    Collaborator

    Hi @buya7, have you followed the windows-specific instructions for cvxpy (as discussed here)?

  3. buya7 commented on Nov 19, 2020

    @buya7
    Author

    Hi @buya7, have you followed the windows-specific instructions for cvxpy (as discussed here)?

    Hi @robertmartin8, thank you for your reply. Indeed, I have followed the instructions for Windows. First installed C++ via Visual Studio and then used "pip install PyPortfolioOpt".

  4. robertmartin8 commented on Nov 19, 2020

    @robertmartin8
    Collaborator

    @buya7 Thanks for letting me know! Could you please try to pip install cvxpy to see if that's causing the problems?

  5. buya7 commented on Nov 19, 2020

    @buya7
    Author

    @robertmartin8 Yes, I received a similar error message with pip install cvxpy

  6. sven-borden commented on Nov 20, 2020

    @sven-borden

    Actually as stated at the end of your error @buya7, it is related to numpy installation on python 3.7 and 3.8 from what I have been tested on. I don't know any workaround now except going to python 3.6 waiting it to be resolved. Eventually installing a previous release of numpy would works

  7. buya7 commented on Nov 21, 2020

    @buya7
    Author

    Hi @sven-borden , thank you very much for your response. I created a new environment running Python 3.6 and added it to Jupyter Notebook. I think I managed to install PyPortfolioOpt, but when I went to jupyter (using the new env) it says that PyPortfolioOpt cannot be found. Moreover, when I ask to check the build it still says py 38_0

    packages in environment at C:\Users\Admin\anaconda3\envs\myenv:

    Name Version Build Channel
    certifi 2020.6.20 pyhd3eb1b0_3
    cvxopt 1.2.5.post1 pypi_0 pypi
    cvxpy 1.1.7 pypi_0 pypi
    ecos 2.0.7.post1 pypi_0 pypi
    future 0.18.2 pypi_0 pypi
    numpy 1.19.3 pypi_0 pypi
    osqp 0.6.1 pypi_0 pypi
    pandas 1.1.4 pypi_0 pypi
    pip 20.2.4 py36haa95532_0
    pyportfolioopt 1.2.7 pypi_0 pypi
    python 3.6.12 h5500b2f_2
    python-dateutil 2.8.1 pypi_0 pypi
    pytz 2020.4 pypi_0 pypi
    scipy 1.5.4 pypi_0 pypi
    scs 2.1.2 pypi_0 pypi
    setuptools 50.3.1 py36haa95532_1
    six 1.15.0 pypi_0 pypi
    sqlite 3.33.0 h2a8f88b_0
    vc 14.1 h0510ff6_4
    vs2015_runtime 14.16.27012 hf0eaf9b_3
    wheel 0.35.1 pyhd3eb1b0_0
    wincertstore 0.2 py36h7fe50ca_0
    zlib 1.2.11 h62dcd97_4

  8. sven-borden commented on Nov 21, 2020

    @sven-borden

    @buya7 that's already a step forward, could you share the code you are trying to run?

  9. buya7 commented on Nov 21, 2020

    @buya7
    Author

    @sven-borden For the environment I used conda create -n myenv python=3.6 and conda activate myenv Then I ran pip install numpy==1.19.3 and then pip install PyPortfolioOpt After that to add the env to Jupyter I used pip install --user ipykernel and python -m ipykernel install --user --name=myenv Now in Jupyter I can create new files with using the new env but it seems that it doesn't work correctly.

  10. buya7 commented on Nov 21, 2020

    @buya7
    Author

    @sven-borden I am trying to run from pypfopt import EfficieantFrontier ; from pypfopt import risk_models and from pypfopt import expected_returns

  11. sven-borden commented on Nov 21, 2020

    @sven-borden

    @buya7 I reproduced your step exactly except that I ran on a jupyter notebook from my newly created env and I can import them well. I guess something wrong is happening with python env finding modules. My "stupid" guess would be to reboot the computer and create new environment a few time to check if it is consistant or not.

    Sorry I don't bring a lots of answers here :(

  12. sven-borden commented on Nov 21, 2020

    @sven-borden

    If it may helps, here are the exact packages in my env.

    # Name                    Version                   Build  Channel
    certifi                   2020.6.20          pyhd3eb1b0_3
    cvxopt                    1.2.5.post1              pypi_0    pypi
    cvxpy                     1.1.7                    pypi_0    pypi
    ecos                      2.0.7.post1              pypi_0    pypi
    future                    0.18.2                   pypi_0    pypi
    numpy                     1.19.3                   pypi_0    pypi
    osqp                      0.6.1                    pypi_0    pypi
    pandas                    1.1.4                    pypi_0    pypi
    pip                       20.2.4           py36h9f7ea03_0
    pyportfolioopt            1.2.7                    pypi_0    pypi
    python                    3.6.12               h5500b2f_2
    python-dateutil           2.8.1                    pypi_0    pypi
    pytz                      2020.4                   pypi_0    pypi
    scipy                     1.5.4                    pypi_0    pypi
    scs                       2.1.2                    pypi_0    pypi
    setuptools                50.3.1           py36h9f7ea03_1
    six                       1.15.0                   pypi_0    pypi
    sqlite                    3.33.0               h2a8f88b_0
    vc                        14.1                 h0510ff6_4
    vs2015_runtime            14.16.27012          hf0eaf9b_3
    wheel                     0.35.1             pyhd3eb1b0_0
    wincertstore              0.2              py36hcdd9a18_0
    zlib                      1.2.11               h33f27b4_4
    
  13. x829901 commented on Nov 29, 2020

    @x829901

    If it may helps, here are the exact packages in my env.

    # Name                    Version                   Build  Channel
    certifi                   2020.6.20          pyhd3eb1b0_3
    cvxopt                    1.2.5.post1              pypi_0    pypi
    cvxpy                     1.1.7                    pypi_0    pypi
    ecos                      2.0.7.post1              pypi_0    pypi
    future                    0.18.2                   pypi_0    pypi
    numpy                     1.19.3                   pypi_0    pypi
    osqp                      0.6.1                    pypi_0    pypi
    pandas                    1.1.4                    pypi_0    pypi
    pip                       20.2.4           py36h9f7ea03_0
    pyportfolioopt            1.2.7                    pypi_0    pypi
    python                    3.6.12               h5500b2f_2
    python-dateutil           2.8.1                    pypi_0    pypi
    pytz                      2020.4                   pypi_0    pypi
    scipy                     1.5.4                    pypi_0    pypi
    scs                       2.1.2                    pypi_0    pypi
    setuptools                50.3.1           py36h9f7ea03_1
    six                       1.15.0                   pypi_0    pypi
    sqlite                    3.33.0               h2a8f88b_0
    vc                        14.1                 h0510ff6_4
    vs2015_runtime            14.16.27012          hf0eaf9b_3
    wheel                     0.35.1             pyhd3eb1b0_0
    wincertstore              0.2              py36hcdd9a18_0
    zlib                      1.2.11               h33f27b4_4
    

    This worked for me. Hopefully, this issue gets fixed.

  14. robertmartin8 commented on Nov 30, 2020

    @robertmartin8
    Collaborator

    Fixed in #230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions