New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fails with KeyError: 'processor_architecture' #626

Closed
fliespl opened this Issue Jul 3, 2016 · 15 comments

Comments

Projects
None yet
9 participants
@fliespl

fliespl commented Jul 3, 2016

Started after yesterdays update

Downloading https://pypi.io/packages/source/s/setuptools/setuptools-24.0.0.zip
Extracting in /tmp/tmpmNBMZ1
Now working in /tmp/tmpmNBMZ1/setuptools-24.0.0
Installing Setuptools
Traceback (most recent call last):
  File "setup.py", line 21, in <module>
    exec(init_file.read(), command_ns)
  File "<string>", line 11, in <module>
  File "/tmp/tmpmNBMZ1/setuptools-24.0.0/setuptools/__init__.py", line 14, in <module>
    from setuptools.extension import Extension
  File "/tmp/tmpmNBMZ1/setuptools-24.0.0/setuptools/extension.py", line 11, in <module>
    from . import msvc
  File "/tmp/tmpmNBMZ1/setuptools-24.0.0/setuptools/msvc.py", line 244, in <module>
    class PlatformInfo:
  File "/tmp/tmpmNBMZ1/setuptools-24.0.0/setuptools/msvc.py", line 253, in PlatformInfo
    current_cpu = safe_env['processor_architecture'].lower()
  File "/usr/lib/python2.7/UserDict.py", line 23, in __getitem__
    raise KeyError(key)
KeyError: 'processor_architecture'
Something went wrong during the installation.
See the error message above.
@mattcl

This comment has been minimized.

mattcl commented Jul 3, 2016

I am hitting this as well. I'm pinning to 23.1.0 for now as a workaround. Of interest, it seems to only affect python 2 (we were doing installs of python packages in an ubuntu 14.04 docker container and the python 3 ones worked fine).

@vadimkry

This comment has been minimized.

vadimkry commented Jul 3, 2016

yep. 24.0.0 also getting this

@anthrotype

This comment has been minimized.

Contributor

anthrotype commented Jul 3, 2016

Could it be related to this? #624

@aabes

This comment has been minimized.

aabes commented Jul 3, 2016

our workaround was to:
Change L11 of "/usr/local/lib/python2.7/dist-packages/setuptools/extension.py

   < from . import msvc9
   > from . import msvc9_support

@anthrotype - I'd vote for - it's related ;)

@JGoutin JGoutin referenced this issue Jul 3, 2016

Merged

msvc fixes #627

@JGoutin

This comment has been minimized.

Contributor

JGoutin commented Jul 3, 2016

I fixed this.
I anyone with this error want to check it now with the updated version for the PR #627 and report here if fix work. Thanks.

@boazin

This comment has been minimized.

boazin commented Jul 3, 2016

@JGoutin - any ETA on the official version to working again?

@JGoutin

This comment has been minimized.

Contributor

JGoutin commented Jul 3, 2016

@boazin I don't manage this project, I am only a contributor.

@beckmani

This comment has been minimized.

beckmani commented Jul 3, 2016

@JGoutin - I checked your Fix on Linux 14.04.1-Ubuntu with python 2.76.
I'm not getting the exception "KeyError: 'processor_architecture'" but I get the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/easy_install", line 7, in <module>
    from setuptools.command.easy_install import main
  File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 14, in <module>
    from setuptools.extension import Extension
  File "/usr/local/lib/python2.7/dist-packages/setuptools/extension.py", line 11, in <module>
    from . import msvc
  File "/usr/local/lib/python2.7/dist-packages/setuptools/msvc.py", line 334, in <module>
    class RegistryInfo:
  File "/usr/local/lib/python2.7/dist-packages/setuptools/msvc.py", line 343, in RegistryInfo
    HKEYS = (winreg.HKEY_USERS,
  File "/usr/lib/python2.7/dist-packages/six.py", line 116, in __getattr__
    _module = self._resolve()
  File "/usr/lib/python2.7/dist-packages/six.py", line 105, in _resolve
    return _import_module(self.mod)
  File "/usr/lib/python2.7/dist-packages/six.py", line 76, in _import_module
    __import__(name)
ImportError: No module named _winreg
@aabes

This comment has been minimized.

aabes commented Jul 3, 2016

A simpler workaround (while waiting for pypi to be updated) could be to:
export processor_architecture=‘'

prior to attempting to install.

tested on python 2.7.6 (but with somewhat dated get-pip.py)

Unfortunately, I'm not in a position to test the patched version :(

@JGoutin

This comment has been minimized.

Contributor

JGoutin commented Jul 3, 2016

@beckmani Thanks for reporting.

Six seem to not correctly raise Import error when importing winreg. I tried another strategy : disabling this module if not on Windows.

Patch updated.

@beckmani

This comment has been minimized.

beckmani commented Jul 3, 2016

@JGoutin - There is still exception. See msvc.py line #336

Traceback (most recent call last):
  File "/usr/local/bin/easy_install", line 7, in <module>
    from setuptools.command.easy_install import main  
File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 14, in <module>
    from setuptools.extension import Extension
  File "/usr/local/lib/python2.7/dist-packages/setuptools/extension.py", line 11, in <module>
    from . import msvc
  File "/usr/local/lib/python2.7/dist-packages/setuptools/msvc.py", line 327, in <module>
    class RegistryInfo:
  File "/usr/local/lib/python2.7/dist-packages/setuptools/msvc.py", line 336, in RegistryInfo
    HKEYS = (winreg.HKEY_USERS,
  File "/usr/lib/python2.7/dist-packages/six.py", line 116, in __getattr__
    _module = self._resolve()
  File "/usr/lib/python2.7/dist-packages/six.py", line 105, in _resolve
    return _import_module(self.mod)
  File "/usr/lib/python2.7/dist-packages/six.py", line 76, in _import_module
    __import__(name)
ImportError: No module named _winreg
@JGoutin

This comment has been minimized.

Contributor

JGoutin commented Jul 3, 2016

@beckmani Thanks

I updated.

@beckmani

This comment has been minimized.

beckmani commented Jul 3, 2016

@JGoutin - This time it worked. Thanks. :-)

@JGoutin

This comment has been minimized.

Contributor

JGoutin commented Jul 3, 2016

@beckmani Nice ! Thanks for your tests !

@jaraco

This comment has been minimized.

Member

jaraco commented Jul 3, 2016

Fixed in #627 and release pending for 24.0.1 release.

@jaraco jaraco closed this Jul 3, 2016

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