wbingli / awscli-plugin-endpoint

An awscli plugin to configure service endpoint from aws configure file
Apache License 2.0
207 stars 23 forks source link

aws configure --profile wasabi (ModuleNotFoundError) #24

Open ForkedInTime opened 2 years ago

ForkedInTime commented 2 years ago

Performing the following:

aws s3 ls --profile wasabi

yields the following: Traceback (most recent call last): File "/usr/local/bin/aws", line 27, in <module> sys.exit(main()) File "/usr/local/bin/aws", line 23, in main return awscli.clidriver.main() File "/home/yetipaw/.local/lib/python3.10/site-packages/awscli/clidriver.py", line 69, in main driver = create_clidriver() File "/home/yetipaw/.local/lib/python3.10/site-packages/awscli/clidriver.py", line 78, in create_clidriver load_plugins(session.full_config.get('plugins', {}), File "/home/yetipaw/.local/lib/python3.10/site-packages/awscli/plugin.py", line 44, in load_plugins modules = _import_plugins(plugin_mapping) File "/home/yetipaw/.local/lib/python3.10/site-packages/awscli/plugin.py", line 58, in _import_plugins plugins.append(__import__(path)) ModuleNotFoundError: No module named 'site-packages-path'

The .aws config file:

[profile wasabi] region = us-east-1 s3 = endpoint_url = https://s3.wasabisys.com s3api = endpoint_url = https://s3.wasabissys.com [plugins] endpoint = awscli_plugin_endpoint cli_legacy_plugin_path = site-packages-path

Trying the following yields the same error: ➜ .aws aws s3 ls --endpoint-url=https://s3.wasabisys.com Traceback (most recent call last): File "/usr/local/bin/aws", line 27, in sys.exit(main()) File "/usr/local/bin/aws", line 23, in main return awscli.clidriver.main() File "/home/yetipaw/.local/lib/python3.10/site-packages/awscli/clidriver.py", line 69, in main driver = create_clidriver() File "/home/yetipaw/.local/lib/python3.10/site-packages/awscli/clidriver.py", line 78, in create_clidriver load_plugins(session.full_config.get('plugins', {}), File "/home/yetipaw/.local/lib/python3.10/site-packages/awscli/plugin.py", line 44, in load_plugins modules = _import_plugins(plugin_mapping) File "/home/yetipaw/.local/lib/python3.10/site-packages/awscli/plugin.py", line 58, in _import_plugins plugins.append(import(path)) ModuleNotFoundError: No module named 'site-packages-path' ➜ .aws

moving the config file to config-backup: ➜ .aws aws s3 ls --endpoint-url=https://s3.wasabisys.com 2022-05-08 09:15:39 somebucket 2022-05-08 14:21:29 anotherbucket ➜ .aws

niknah commented 2 years ago

Change the "cli_legacy_plugin_path" line in ~/.aws/config to...

cli_legacy_plugin_path = /home/YOURUSERNAME/.local/lib/python3.10/site-packages

Where YOURUSERNAME is your username (yetipaw?). This is for Linux.

Wasabi's endpoint_url is like https://s3.ap-southeast-2.wasabisys.com You put the region in the URL.

qeba commented 2 years ago

Change the "cli_legacy_plugin_path" line in ~/.aws/config to...

cli_legacy_plugin_path = /home/YOURUSERNAME/.local/lib/python3.10/site-packages

Where YOURUSERNAME is your username (yetipaw?). This is for Linux.

Wasabi's endpoint_url is like https://s3.ap-southeast-2.wasabisys.com You put the region in the URL.

Any idea how about for Windows ?. what the path should be?

niknah commented 2 years ago

In windows it is... %USERPROFILE%.aws\config https://docs.aws.amazon.com/sdkref/latest/guide/file-location.html

For the cli_legacy_plugin_path it's best to search for "site-packages" in your computer. may look something like... C:\Users\YOURUSERNAME\AppData\Local\Programs\Python\Python310\Lib\site-packages