Skip to content
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
Closed

Install fails with KeyError: 'processor_architecture' #626

fliespl opened this issue Jul 3, 2016 · 15 comments

Comments

@fliespl
Copy link

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
Copy link

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
Copy link

vadimkry commented Jul 3, 2016

yep. 24.0.0 also getting this

@anthrotype
Copy link

Could it be related to this? #624

@aabes
Copy link

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 mentioned this issue Jul 3, 2016
@JGoutin
Copy link
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
Copy link

boazin commented Jul 3, 2016

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

@JGoutin
Copy link
Contributor

JGoutin commented Jul 3, 2016

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

@beckmani
Copy link

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
Copy link

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
Copy link
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
Copy link

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
Copy link
Contributor

JGoutin commented Jul 3, 2016

@beckmani Thanks

I updated.

@beckmani
Copy link

beckmani commented Jul 3, 2016

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

@JGoutin
Copy link
Contributor

JGoutin commented Jul 3, 2016

@beckmani Nice ! Thanks for your tests !

@jaraco
Copy link
Member

jaraco commented Jul 3, 2016

Fixed in #627 and release pending for 24.0.1 release.

@jaraco jaraco closed this as completed Jul 3, 2016
tanaypf9 pushed a commit to tanaypf9/pf9-requirements that referenced this issue May 20, 2024
Patch Set 1: Code-Review+2

pypa/setuptools#626 is the upstream issue, +2, waiting on +w.

Patch-set: 1
Reviewer: Gerrit User 14288 <14288@4a232e18-c5a9-48ee-94c0-e04e7cca6543>
Label: Code-Review=+2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants