cvxgrp / diffcp

Differentiation through cone programs
Apache License 2.0
91 stars 19 forks source link

(Windows installation) Failed to build wheel for diffcp (setup.py) ... error #25

Closed tinyxuyan closed 4 years ago

tinyxuyan commented 4 years ago

When I try to install diffcp in anaconda prompt, it fails to build wheel for diffcp.

The detailed error, as it outputs, is " TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType". I wonder the path here.

The output error is listed as below:

Building wheels for collected packages: diffcp
  Building wheel for diffcp (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\www\anaconda3\envs\tensorflow20\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\LIFI\\AppData\\Local\\Temp\\pip-install-wa864jaq\\diffcp\\setup.py'"'"'; __file__='"'"'C:\\Users\\LIFI\\AppData\\Local\\Temp\\pip-install-wa864jaq\\diffcp\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\LIFI\AppData\Local\Temp\pip-wheel-41hdnwlc' --python-tag cp36
       cwd: C:\Users\LIFI\AppData\Local\Temp\pip-install-wa864jaq\diffcp\
  Complete output (59 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\diffcp
  copying diffcp\cones.py -> build\lib.win-amd64-3.6\diffcp
  copying diffcp\cone_program.py -> build\lib.win-amd64-3.6\diffcp
  copying diffcp\utils.py -> build\lib.win-amd64-3.6\diffcp
  copying diffcp\__init__.py -> build\lib.win-amd64-3.6\diffcp
  running build_ext
  building '_diffcp' extension
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\LIFI\AppData\Local\Temp\pip-install-wa864jaq\diffcp\setup.py", line 108, in <module>
      "Programming Language :: Python :: 3",
    File "c:\www\anaconda3\envs\tensorflow20\lib\site-packages\setuptools\__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "c:\www\anaconda3\envs\tensorflow20\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "c:\www\anaconda3\envs\tensorflow20\lib\site-packages\setuptools\command\build_ext.py", line 84, in run
      _build_ext.run(self)
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\command\build_ext.py", line 339, in run
      self.build_extensions()
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\command\build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "c:\www\anaconda3\envs\tensorflow20\lib\site-packages\setuptools\command\build_ext.py", line 205, in build_extension
      _build_ext.build_extension(self, ext)
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\command\build_ext.py", line 533, in build_extension
      depends=ext.depends)
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\_msvccompiler.py", line 345, in compile
      self.initialize()
    File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\_msvccompiler.py", line 238, in initialize
      vc_env = _get_vc_env(plat_spec)
    File "c:\www\anaconda3\envs\tensorflow20\lib\site-packages\setuptools\msvc.py", line 170, in msvc14_get_vc_env
      return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
    File "c:\www\anaconda3\envs\tensorflow20\lib\site-packages\setuptools\msvc.py", line 1619, in return_env
      if self.vs_ver >= 14 and isfile(self.VCRuntimeRedist):
    File "c:\www\anaconda3\envs\tensorflow20\lib\genericpath.py", line 30, in isfile
      st = os.stat(path)
  TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
  ----------------------------------------
  ERROR: Failed building wheel for diffcp
  Running setup.py clean for diffcp
Failed to build diffcp
Installing collected packages: diffcp
    Running setup.py install for diffcp ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\www\anaconda3\envs\tensorflow20\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\LIFI\\AppData\\Local\\Temp\\pip-install-wa864jaq\\diffcp\\setup.py'"'"'; __file__='"'"'C:\\Users\\LIFI\\AppData\\Local\\Temp\\pip-install-wa864jaq\\diffcp\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\LIFI\AppData\Local\Temp\pip-record-o3aral_e\install-record.txt' --single-version-externally-managed --compile
         cwd: C:\Users\LIFI\AppData\Local\Temp\pip-install-wa864jaq\diffcp\
    Complete output (61 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\diffcp
    copying diffcp\cones.py -> build\lib.win-amd64-3.6\diffcp
    copying diffcp\cone_program.py -> build\lib.win-amd64-3.6\diffcp
    copying diffcp\utils.py -> build\lib.win-amd64-3.6\diffcp
    copying diffcp\__init__.py -> build\lib.win-amd64-3.6\diffcp
    running build_ext
    building '_diffcp' extension
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\LIFI\AppData\Local\Temp\pip-install-wa864jaq\diffcp\setup.py", line 108, in <module>
        "Programming Language :: Python :: 3",
      File "c:\www\anaconda3\envs\tensorflow20\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\www\anaconda3\envs\tensorflow20\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\www\anaconda3\envs\tensorflow20\lib\site-packages\setuptools\command\build_ext.py", line 84, in run
        _build_ext.run(self)
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\command\build_ext.py", line 339, in run
        self.build_extensions()
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\command\build_ext.py", line 448, in build_extensions
        self._build_extensions_serial()
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial
        self.build_extension(ext)
      File "c:\www\anaconda3\envs\tensorflow20\lib\site-packages\setuptools\command\build_ext.py", line 205, in build_extension
        _build_ext.build_extension(self, ext)
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\command\build_ext.py", line 533, in build_extension
        depends=ext.depends)
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\_msvccompiler.py", line 345, in compile
        self.initialize()
      File "c:\www\anaconda3\envs\tensorflow20\lib\distutils\_msvccompiler.py", line 238, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "c:\www\anaconda3\envs\tensorflow20\lib\site-packages\setuptools\msvc.py", line 170, in msvc14_get_vc_env
        return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
      File "c:\www\anaconda3\envs\tensorflow20\lib\site-packages\setuptools\msvc.py", line 1619, in return_env
        if self.vs_ver >= 14 and isfile(self.VCRuntimeRedist):
      File "c:\www\anaconda3\envs\tensorflow20\lib\genericpath.py", line 30, in isfile
        st = os.stat(path)
    TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\www\anaconda3\envs\tensorflow20\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\LIFI\\AppData\\Local\\Temp\\pip-install-wa864jaq\\diffcp\\setup.py'"'"'; __file__='"'"'C:\\Users\\LIFI\\AppData\\Local\\Temp\\pip-install-wa864jaq\\diffcp\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\LIFI\AppData\Local\Temp\pip-record-o3aral_e\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
akshayka commented 4 years ago

That looks like a problem with your installation toolchain. Are you using a recent version of pip? I would also try installing in a fresh virtual environment (e.g., using virtualenv, not conda).

tinyxuyan commented 4 years ago

I have created a new virtualenv. The pip has been updated to the latest version 19.3.1. The problem still remained. @akshayka I downloaded the diffcp-1.0.12.tar.gz and installed it using 'pip install diffcp-1.0.12.tar.gz' in the specific file path. Is there anything wrong?

akshayka commented 4 years ago

Sounds like you used the right commands. Sorry about the errors! diffcp is still a very new package, and we haven’t tested it on windows yet.

We’ll try to set up continuous integration tests for windows, so we can find out if we have a mistake in our setup script. Once we have a tested workflow for installing on windows, we’ll update this issue with installation instructions.

tinyxuyan commented 4 years ago

Thank you! Waiting for your update.

sbarratt commented 4 years ago

We started to add windows CI here: https://github.com/cvxgrp/diffcp/pull/26

akshayka commented 4 years ago

@bugzhu, we've added Windows CI and are able to successfully build on 64-bit Windows. Perhaps try installing diffcp as done in our appveyor (windows) installation script: https://github.com/cvxgrp/diffcp/blob/master/.appveyor.yml