awslabs / aws-shell

An integrated shell for working with the AWS CLI.
Apache License 2.0
7.15k stars 770 forks source link

Error running aws-shell in virtualenv #207

Open lfrost opened 5 years ago

lfrost commented 5 years ago

When installing the latest version of awscli and aws-shell in a virtualenv on Debian 9, running aws-shell fails with an error creating the autocomplete index.

First run, creating autocomplete index... Traceback (most recent call last): File "/home/aws/aws/lib/python3.5/site-packages/awsshell/utils.py", line 84, in file_contents with open(filename, mode) as f: FileNotFoundError: [Errno 2] No such file or directory: '/home/aws/.aws/shell/cache/completions-1.16.14.json'

The Debian packages for awscli and aws-shell work. Here are the versions for those.

aws-shell/stable 0.1.1-2 awscli/stable 1.11.13-1

Details attached for Debian 9. I have also tried Debian 10 and Fedora 28 with similar results.

python3-virtualenv-aws-debian-9.txt

justinclayton commented 5 years ago

I get the same error in a python 3.7 virtualenv on Mac OS X 10.12.6.

davewongillies commented 5 years ago

Seems to be the same as https://github.com/awslabs/aws-shell/issues/208 which was closed even though others are having the same issue

mlcloudsec commented 5 years ago

Having the same issue

godfrey-cw commented 5 years ago

This might be the same issue, although it's a different FileNotFound than the one above:

This error traceback appears a few seconds after launching the shell:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/awsshell/makeindex.py", line 88, in write_doc_index
    do_write_doc_index(db, help_command, close_db_on_finish=should_close)
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/awsshell/makeindex.py", line 93, in do_write_doc_index
    _index_docs(db, help_command)
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/awsshell/makeindex.py", line 111, in _index_docs
    _index_docs(db, sub_help_command)
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/awsshell/makeindex.py", line 108, in _index_docs
    text_docs = render_docs_for_cmd(sub_help_command)
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/awsshell/makeindex.py", line 117, in render_docs_for_cmd
    help_command(None, None)
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/awscli/customizations/commands.py", line 358, in __call__
    docevents.generate_events(self.session, self)
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/botocore/docs/bcdoc/docevents.py", line 46, in generate_events
    help_command=help_command)
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/botocore/session.py", line 671, in emit
    return self._events.emit(event_name, **kwargs)
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/botocore/hooks.py", line 356, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/botocore/hooks.py", line 228, in emit
    return self._emit(event_name, kwargs)
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/botocore/hooks.py", line 211, in _emit
    response = handler(**kwargs)
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/awscli/customizations/commands.py", line 376, in doc_synopsis_start
    if not help_command.synopsis:
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/awscli/customizations/commands.py", line 326, in synopsis
    return self._get_doc_contents('_synopsis')
  File "/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/awscli/customizations/commands.py", line 347, in _get_doc_contents
    with _open(doc_path) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/miniconda3/envs/amazon/lib/python3.7/site-packages/awscli/examples/emr/create-cluster-synopsis.txt'

Current python environment:

asn1crypto==0.24.0
aws-shell==0.2.1
awscli==1.16.179
boto3==1.9.169
botocore==1.12.169
certifi==2019.3.9
cffi==1.12.3
colorama==0.3.9
configobj==5.0.6
cryptography==2.7
docutils==0.14
idna==2.8
jmespath==0.9.4
powerline-status==2.7
prompt-toolkit==1.0.16
pyasn1==0.4.5
pycparser==2.19
Pygments==2.4.2
pyOpenSSL==19.0.0
PySocks==1.7.0
python-dateutil==2.8.0
PyYAML==5.1
rsa==3.4.2
s3transfer==0.2.0
six==1.12.0
urllib3==1.25.3
wcwidth==0.1.7
dz902 commented 5 years ago

Same here, "file not found" for something related to EMR

BwL1289 commented 4 years ago

same here.

aws> Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/awsshell/makeindex.py", line 88, in write_doc_index
    do_write_doc_index(db, help_command, close_db_on_finish=should_close)] Focus: cli  [F10] Exit
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/awsshell/makeindex.py", line 93, in do_write_doc_index
    _index_docs(db, help_command)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/awsshell/makeindex.py", line 111, in _index_docs
    _index_docs(db, sub_help_command)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/awsshell/makeindex.py", line 108, in _index_docs
    text_docs = render_docs_for_cmd(sub_help_command)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/awsshell/makeindex.py", line 117, in render_docs_for_cmd
    help_command(None, None)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/awscli/customizations/commands.py", line 358, in __call__
    docevents.generate_events(self.session, self)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/docs/bcdoc/docevents.py", line 46, in generate_events
    help_command=help_command)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/session.py", line 672, in emit
    return self._events.emit(event_name, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/hooks.py", line 356, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/hooks.py", line 228, in emit
    return self._emit(event_name, kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/hooks.py", line 211, in _emit
    response = handler(**kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/awscli/customizations/commands.py", line 376, in doc_synopsis_start
    if not help_command.synopsis:
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/awscli/customizations/commands.py", line 326, in synopsis
    return self._get_doc_contents('_synopsis')
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/awscli/customizations/commands.py", line 347, in _get_doc_contents
    with _open(doc_path) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/awscli/examples/emr/create-cluster-synopsis.txt'