Skip to content

Build fails on Windows with Python 3.5, VS 2015 #380

@chrullrich

Description

@chrullrich
> py -3 setup.py build_ext

[...]
File "C:\Program Files\Python35\lib\site-packages\setuptools\command\build_ext.py", line 49, in run
  _build_ext.run(self)
File "C:\Program Files\Python35\lib\distutils\command\build_ext.py", line 338, in run
  self.build_extensions()
File "C:\Program Files\Python35\lib\distutils\command\build_ext.py", line 447, in build_extensions
  self._build_extensions_serial()
File "C:\Program Files\Python35\lib\distutils\command\build_ext.py", line 472, in _build_extensions_serial
  self.build_extension(ext)
File "setup.py", line 308, in build_extension
  '-outputresource:%s;2' % ext_path])
File "C:\Program Files\Python35\lib\distutils\_msvccompiler.py", line 513, in spawn
  os.environ['path'] = self._paths
AttributeError: 'MSVCCompiler' object has no attribute '_paths'

I managed to fix this by calling self.initialize() at the top of spawn() (see last item in the traceback):

 def spawn(self, cmd):
+    if not self.initialized:
+        self.initialize()
     old_path = os.getenv('path')

It builds correctly now, but I suspect the bug may be in psycopg2 rather than distutils. Perhaps you are not supposed to call spawn() on an uninitialized instance?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions