[PYTHON] Geschichten und Lösungen für das AWS CLI-Update

"Übrigens habe ich die AWS-CLI nicht aktualisiert." Ich dachte so und versuchte, sie zu aktualisieren. Dann war ich versehentlich süchtig nach ...


Führen Sie das Update zunächst normal aus ...

[ore@server ~]$ sudo pip install --upgrade awscli
Collecting awscli from https://pypi.python.org/packages/py2.py3/a/awscli/awscli-1.8.4-py2.py3-none-any.whl#md5=f7a52bd35ff7ed1b8eede7cb82049f39
  Downloading awscli-1.8.4-py2.py3-none-any.whl (769kB)
    100% |################################| 770kB 3.5MB/s
Requirement already up-to-date: colorama<=0.3.3,>=0.2.5 in /usr/lib/python2.6/site-packages (from awscli)
Requirement already up-to-date: docutils>=0.10 in /usr/lib/python2.6/site-packages (from awscli)
Collecting argparse>=1.1 from https://pypi.python.org/packages/2.7/a/argparse/argparse-1.4.0-py2.py3-none-any.whl#md5=c37216a954c8669054e2b2c54853dd49 (from awscli)
  Downloading argparse-1.4.0-py2.py3-none-any.whl
Requirement already up-to-date: rsa<=3.1.4,>=3.1.2 in /usr/lib/python2.6/site-packages (from awscli)
Collecting botocore==1.2.2 (from awscli)
  Downloading botocore-1.2.2-py2.py3-none-any.whl (1.8MB)
    100% |################################| 1.8MB 3.0MB/s
Requirement already up-to-date: pyasn1>=0.1.3 in /usr/lib/python2.6/site-packages (from rsa<=3.1.4,>=3.1.2->awscli)
Collecting ordereddict==1.1 (from botocore==1.2.2->awscli)
  Downloading ordereddict-1.1.tar.gz
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help
    error: invalid command 'egg_info'
    Complete output from command python setup.py egg_info:
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

       or: -c --help [cmd1 cmd2 ...]

       or: -c --help-commands

       or: -c cmd --help



    error: invalid command 'egg_info'

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dBji6C/ordereddict

Ich habe mich entschlossen, die Lösung im Internet nachzuschlagen, weil "das ein Fehler ist". "Ich verstehe, ich sollte das aktualisieren, was Setuptools heißt." (* Referenz 1)

[ore@server ~]$ sudo pip install --upgrade setuptools
Collecting setuptools from https://pypi.python.org/packages/3.4/s/setuptools/setuptools-18.3.1-py2.py3-none-any.whl#md5=a21a4d02d0bab2eac499cca72faeb076
  Downloading setuptools-18.3.1-py2.py3-none-any.whl (462kB)
    100% |################################| 462kB 1.5MB/s
Installing collected packages: setuptools
  Found existing installation: setuptools 0.6rc11
    Can't uninstall 'setuptools'. No files were found to uninstall.

Successfully installed setuptools-0.6rc11

Versuchen Sie nach Abschluss des Setuptools-Updates erneut, die aws cli zu aktualisieren ...

[ore@server ~]$ sudo pip install --upgrade awscli
Collecting awscli from https://pypi.python.org/packages/py2.py3/a/awscli/awscli-1.8.4-py2.py3-none-any.whl#md5=f7a52bd35ff7ed1b8eede7cb82049f39
  Using cached awscli-1.8.4-py2.py3-none-any.whl
Requirement already up-to-date: colorama<=0.3.3,>=0.2.5 in /usr/lib/python2.6/site-packages (from awscli)
Requirement already up-to-date: docutils>=0.10 in /usr/lib/python2.6/site-packages (from awscli)
Collecting argparse>=1.1 from https://pypi.python.org/packages/2.7/a/argparse/argparse-1.4.0-py2.py3-none-any.whl#md5=c37216a954c8669054e2b2c54853dd49 (from awscli)
  Using cached argparse-1.4.0-py2.py3-none-any.whl
Requirement already up-to-date: rsa<=3.1.4,>=3.1.2 in /usr/lib/python2.6/site-packages (from awscli)
Collecting botocore==1.2.2 (from awscli)
  Using cached botocore-1.2.2-py2.py3-none-any.whl
Requirement already up-to-date: pyasn1>=0.1.3 in /usr/lib/python2.6/site-packages (from rsa<=3.1.4,>=3.1.2->awscli)
Collecting ordereddict==1.1 (from botocore==1.2.2->awscli)
  Using cached ordereddict-1.1.tar.gz
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help
    error: invalid command 'egg_info'
    Complete output from command python setup.py egg_info:
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

       or: -c --help [cmd1 cmd2 ...]

       or: -c --help-commands

       or: -c cmd --help



    error: invalid command 'egg_info'

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-HzKUun/ordereddict

** "Oh, der gleiche Fehler? Es wurde geschrieben, dass wenn Sie dies tun, es geheilt wird!" ** (Beschuldigen Sie nicht andere) Also habe ich beschlossen, eine andere Methode zu untersuchen (* Referenz 2).

[ore@server ~]$ curl -O http://python-distribute.org/distribute_setup.py
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[ore@server ~]$ sudo python distribute_setup.py
python: can't open file 'distribute_setup.py': [Errno 2] No such file or directory
[ore@server ~]$

Ich dachte: "Es ist komisch. Warum gibt es keine Datei?" Und versuchte, mit einem Browser direkt darauf zuzugreifen ...

http://python-distribute.org/distribute_setup.py → http://ww43.python-distribute.org/distribute_setup.py

"Oh, ich werde umgeleitet ... Nun, ** die Domain steht zum Verkauf! Deshalb gibt es keine Dateien, die heruntergeladen werden können !! **"

Also beschloss ich, weiter nachzuforschen, während ich weinen wollte. Dann war da! Die Lösung ist!

[ore@server ~]$ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
--2015-09-16 11:58:39--  https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
Resolving bitbucket.org... 131.103.20.167, 131.103.20.168
Connecting to bitbucket.org|131.103.20.167|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11434 (11K) [text/plain]
Saving to: “ez_setup.py”

100%[==========================================================>] 11,434      --.-K/s   in 0s

2015-09-16 11:58:40 (333 MB/s) - “ez_setup.py” saved [11434/11434]

[ore@server ~]$ sudo python ez_setup.py
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-18.3.1.zip
Extracting in /tmp/tmprVQjOi
Now working in /tmp/tmprVQjOi/setuptools-18.3.1
Installing Setuptools
running install
running bdist_egg
running egg_info
(snip...)
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying setuptools.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying setuptools.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying setuptools.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying setuptools.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying setuptools.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying setuptools.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying setuptools.egg-info/zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
creating dist
creating 'dist/setuptools-18.3.1-py2.6.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing setuptools-18.3.1-py2.6.egg
Copying setuptools-18.3.1-py2.6.egg to /usr/lib/python2.6/site-packages
Adding setuptools 18.3.1 to easy-install.pth file
Installing easy_install script to /usr/bin
Installing easy_install-2.6 script to /usr/bin

Installed /usr/lib/python2.6/site-packages/setuptools-18.3.1-py2.6.egg
Processing dependencies for setuptools==18.3.1
Finished processing dependencies for setuptools==18.3.1

"Vielleicht ist das cool?"

[ore@server ~]$ sudo pip install --upgrade awscli
Collecting awscli from https://pypi.python.org/packages/py2.py3/a/awscli/awscli-1.8.4-py2.py3-none-any.whl#md5=f7a52bd35ff7ed1b8eede7cb82049f39
  Using cached awscli-1.8.4-py2.py3-none-any.whl
Requirement already up-to-date: colorama<=0.3.3,>=0.2.5 in /usr/lib/python2.6/site-packages (from awscli)
Requirement already up-to-date: docutils>=0.10 in /usr/lib/python2.6/site-packages (from awscli)
Collecting argparse>=1.1 from https://pypi.python.org/packages/2.7/a/argparse/argparse-1.4.0-py2.py3-none-any.whl#md5=c37216a954c8669054e2b2c54853dd49 (from awscli)
  Using cached argparse-1.4.0-py2.py3-none-any.whl
Requirement already up-to-date: rsa<=3.1.4,>=3.1.2 in /usr/lib/python2.6/site-packages (from awscli)
Collecting botocore==1.2.2 (from awscli)
  Using cached botocore-1.2.2-py2.py3-none-any.whl
Requirement already up-to-date: pyasn1>=0.1.3 in /usr/lib/python2.6/site-packages (from rsa<=3.1.4,>=3.1.2->awscli)
Collecting ordereddict==1.1 (from botocore==1.2.2->awscli)
  Using cached ordereddict-1.1.tar.gz
    /tmp/pip-build-kYyZ1w/ordereddict/setup.py:12: DeprecationWarning: Parameters to load are deprecated.  Call .resolve and .require separately.

(snip...)

  Found existing installation: awscli 1.7.45
    Uninstalling awscli-1.7.45:
      Successfully uninstalled awscli-1.7.45

Successfully installed argparse-1.4.0 awscli-1.8.4 botocore-1.2.2 ordereddict-1.1 simplejson-3.3.0
[ore@server ~]$ aws --version
aws-cli/1.8.4 Python/2.6.6 Linux/2.6.32-504.1.3.el6.centos.plus.x86_64

"Ich hab es geschafft ...!"


Kurz zusammengefasst wurde dies durch DLing this und Ausführen von sudo python ez_setup.py behoben! !! (* Referenz 3) Jameel Grand, danke!

Ich hoffe, diese Sucht wird jemandes Sorgen lösen.


Referenz:

  1. http://kaworu.jpn.org/python/pip#.E8.A7.A3.E6.B1.BA.E6.96.B9.E6.B3.95_2
  2. http://blog.gogo-games.com/archives/28446278.html
  3. http://stackoverflow.com/questions/31719816/pip-fails-to-install-anything-error-invalid-command-egg-info

Recommended Posts

Geschichten und Lösungen für das AWS CLI-Update
AWS CLI-Installationsverfahren
Über "Lamvery", ein Bereitstellungs- und Verwaltungstool für AWS Lambda
Probleme und Lösungen bei der Frage nach MySQL db in Python 3
Kampf gegen japanische Dateinamen: Rubymine, AWS CLI, Docker für Windows (1) --AWS CLI