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

NoRegionError #1

Open
yanmi89 opened this issue Mar 5, 2024 · 1 comment
Open

NoRegionError #1

yanmi89 opened this issue Mar 5, 2024 · 1 comment
Assignees

Comments

@yanmi89
Copy link
Collaborator

yanmi89 commented Mar 5, 2024

I'm getting a no region error. Someone on AWS posted this and looks like it worked fine on their local computer but once it was on github, this occurred. Is it possible to specify the region in the code?

Error:
yanmi89@DESKTOP-6E3C2LF:~/eecs280/p1-stats/stock_analysis$ python3 index.py
Traceback (most recent call last):
File "/home/yanmi89/eecs280/p1-stats/stock_analysis/index.py", line 19, in
create_tables_if_not_exist()
File "/home/yanmi89/eecs280/p1-stats/stock_analysis/dynamodb.py", line 18, in create_tables_if_not_exist
client = get_low_level_db_client()
File "/home/yanmi89/eecs280/p1-stats/stock_analysis/dynamodb.py", line 72, in get_low_level_db_client
return boto3.client(
File "/home/yanmi89/.local/lib/python3.10/site-packages/boto3/init.py", line 92, in client
return _get_default_session().client(*args, **kwargs)
File "/home/yanmi89/.local/lib/python3.10/site-packages/boto3/session.py", line 299, in client
return self._session.create_client(
File "/home/yanmi89/.local/lib/python3.10/site-packages/botocore/session.py", line 997, in create_client
client = client_creator.create_client(
File "/home/yanmi89/.local/lib/python3.10/site-packages/botocore/client.py", line 161, in create_client
client_args = self._get_client_args(
File "/home/yanmi89/.local/lib/python3.10/site-packages/botocore/client.py", line 508, in _get_client_args
return args_creator.get_client_args(
File "/home/yanmi89/.local/lib/python3.10/site-packages/botocore/args.py", line 100, in get_client_args
final_args = self.compute_client_args(
File "/home/yanmi89/.local/lib/python3.10/site-packages/botocore/args.py", line 219, in compute_client_args
endpoint_config = self._compute_endpoint_config(
File "/home/yanmi89/.local/lib/python3.10/site-packages/botocore/args.py", line 369, in _compute_endpoint_config
return self._resolve_endpoint(**resolve_endpoint_kwargs)
File "/home/yanmi89/.local/lib/python3.10/site-packages/botocore/args.py", line 474, in _resolve_endpoint
return endpoint_bridge.resolve(
File "/home/yanmi89/.local/lib/python3.10/site-packages/botocore/client.py", line 613, in resolve
resolved = self.endpoint_resolver.construct_endpoint(
File "/home/yanmi89/.local/lib/python3.10/site-packages/botocore/regions.py", line 229, in construct_endpoint
result = self._endpoint_for_partition(
File "/home/yanmi89/.local/lib/python3.10/site-packages/botocore/regions.py", line 277, in _endpoint_for_partition
raise NoRegionError()
botocore.exceptions.NoRegionError: You must specify a region.

@yankevn
Copy link
Owner

yankevn commented Mar 7, 2024

Make sure to follow the python virtual environment tutorial first. After you activate you virtual environment and upgrade pip, just run pip install -r requirements.txt and then try running the code again.

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

2 participants