-
-
Notifications
You must be signed in to change notification settings - Fork 516
Closed
Labels
Milestone
Description
> 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?