尝试安装AWS CLI工具时出现python错误

时间:2017-04-21 12:40:41

标签: python amazon-web-services pip ubuntu-12.04

我有Python 2.7,我正在尝试安装AWS CLI工具。我遵循此处列出的AWS CLI说明http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-bundle.html

curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o
"awscli-bundle.zip" 
unzip awscli-bundle.zip 
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

运行上述命令后,我收到错误

Traceback (most recent call last):
  File "./awscli-bundle/install", line 18, in <module>
    os.path.dirname(os.path.abspath(__file__)), 'packages')
  File "/usr/lib/python2.7/posixpath.py", line 347, in abspath
    cwd = os.getcwd()
OSError: [Errno 2] No such file or directory

我试图运行

sudo pip install --upgrade pip 
sudo pip install --upgrade virtualenv

但我收到这两个命令的错误

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.0', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 337, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2279, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 11, in <module>
    from pip.basecommand import command_dict, load_command, load_all_commands, command_names
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 11, in <module>
    from pip.baseparser import parser, ConfigOptionParser, UpdatingDefaultsHelpFormatter
  File "/usr/lib/python2.7/dist-packages/pip/baseparser.py", line 9, in <module>
    from pip.locations import default_config_file, default_log_file
  File "/usr/lib/python2.7/dist-packages/pip/locations.py", line 22, in <module>
    build_prefix = os.path.join(os.getcwd(), 'build')
OSError: [Errno 2] No such file or directory

我正在尝试在Ubuntu 12.04.5 LTS(GNU / Linux 3.2.0-115-generic x86_64)上修复此问题。

0 个答案:

没有答案