Proxy error when i install PlatformIO Core in ubuntu20.04 with scripts

Error when i use

# change directory to folder where is located downloaded "get-platformio.py"
cd /path/to/dir/where/is/located/get-platformio.py/script

# run it
python get-platformio.py

to install my PlatformIO Core in ubuntu 20.04.4LTS
errors are as follows:

❯ python3 get*.py                          
Installer version: 1.1.1
Platform: Linux-5.13.0-37-generic-x86_64-with-glibc2.29
Python version: 3.8.10 (default, Nov 26 2021, 20:14:08) 
[GCC 9.3.0]
Python path: /usr/bin/python3
Creating a virtual environment at /home/lj1ang/.platformio/penv
/usr/bin/python3
Traceback (most recent call last):
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/urllib3/connection.py", line 174, in _new_conn
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/urllib3/util/connection.py", line 72, in create_connection
  File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/urllib3/connectionpool.py", line 700, in urlopen
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/urllib3/connectionpool.py", line 994, in _prepare_proxy
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/urllib3/connection.py", line 358, in connect
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/urllib3/connection.py", line 186, in _new_conn
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f0befd26910>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/requests/adapters.py", line 440, in send
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/urllib3/connectionpool.py", line 785, in urlopen
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/urllib3/util/retry.py", line 592, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.registry.platformio.org', port=443): Max retries exceeded with url: /v3/packages/platformio/tool/python-portable (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f0befd26910>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "get-platformio.py", line 68, in <module>
    main()
  File "get-platformio.py", line 60, in main
    bootstrap()
  File "get-platformio.py", line 46, in bootstrap
    pioinstaller.__main__.main()
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/pioinstaller/__main__.py", line 133, in main
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/click/core.py", line 1128, in __call__
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/click/core.py", line 1053, in main
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/click/core.py", line 1637, in invoke
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/click/core.py", line 1395, in invoke
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/click/core.py", line 754, in invoke
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/click/decorators.py", line 26, in new_func
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/pioinstaller/__main__.py", line 61, in cli
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/pioinstaller/core.py", line 70, in install_platformio_core
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/pioinstaller/core.py", line 98, in _install_platformio_core
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/pioinstaller/penv.py", line 58, in create_core_penv
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/pioinstaller/python.py", line 70, in fetch_portable_python
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/pioinstaller/python.py", line 97, in get_portable_python_url
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/requests/api.py", line 75, in get
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/requests/api.py", line 61, in request
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/requests/sessions.py", line 529, in request
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/requests/sessions.py", line 645, in send
  File "/home/lj1ang/ProSoftware/Platform_IO/.piocore-installer-jvcw8cvm/tmpk8ufcxrw/pioinstaller.zip/requests/adapters.py", line 513, in send
requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.registry.platformio.org', port=443): Max retries exceeded with url: /v3/packages/platformio/tool/python-portable (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f0befd26910>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')))

I know that proxy is not set properly
but what is the right way to set it?

If you use VSCode, there is a UI for this. If you mean CLI, see