As of Twilio 6.46 the TwilioRestClient has been deprecated. Here it's been replaced with just Client
Removed get_dotenv() because we actually don't need it
isort imports
Reformatted code with black
Additional Details
I couldn't load or install dotenv because of the error below Below error was because of not installing proper library. The correct library to use is python-dotenv==0.15.0
See error log
```bash
❯ pip install dotenv
Collecting dotenv
Downloading dotenv-0.0.5.tar.gz (2.4 kB)
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-install-vr9tudgo/dotenv/setup.py'"'"'; __file__='"'"'/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-install-vr9tudgo/dotenv/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-pip-egg-info-s52onefd
cwd: /private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-install-vr9tudgo/dotenv/
Complete output (52 lines):
WARNING: The wheel package is not available.
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-wheel-5abq7b_z/distribute/setup.py'"'"'; __file__='"'"'/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-wheel-5abq7b_z/distribute/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-pip-egg-info-wt2t_6up
cwd: /private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-wheel-5abq7b_z/distribute/
Complete output (15 lines):
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-wheel-5abq7b_z/distribute/setuptools/__init__.py", line 2, in
from setuptools.extension import Extension, Library
File "/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-wheel-5abq7b_z/distribute/setuptools/extension.py", line 5, in
from setuptools.dist import _get_unpatched
File "/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-wheel-5abq7b_z/distribute/setuptools/dist.py", line 7, in
from setuptools.command.install import install
File "/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-wheel-5abq7b_z/distribute/setuptools/command/__init__.py", line 8, in
from setuptools.command import install_scripts
File "/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-wheel-5abq7b_z/distribute/setuptools/command/install_scripts.py", line 3, in
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-wheel-5abq7b_z/distribute/pkg_resources.py", line 1518, in
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/installer.py", line 128, in fetch_build_egg
subprocess.check_call(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 341, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/tmpyanpyn9z', '--quiet', 'distribute']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-install-vr9tudgo/dotenv/setup.py", line 23, in
scripts=['scripts/dotenv']
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 164, in setup
_install_setup_requires(attrs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 702, in fetch_build_eggs
replace_conflicting=True,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 781, in resolve
replace_conflicting=replace_conflicting
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1064, in best_match
return self.obtain(req, installer)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1076, in obtain
return installer(requirement)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
return fetch_build_egg(self, req)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/installer.py", line 130, in fetch_build_egg
raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/tmpyanpyn9z', '--quiet', 'distribute']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
```
What
6.46
theTwilioRestClient
has been deprecated. Here it's been replaced with justClient
get_dotenv()
because we actually don't need itisort
importsblack
Additional Details
I couldn't load or installBelow error was because of not installing proper library. The correct library to use isdotenv
because of the error belowpython-dotenv==0.15.0
See error log
```bash ❯ pip install dotenv Collecting dotenv Downloading dotenv-0.0.5.tar.gz (2.4 kB) ERROR: Command errored out with exit status 1: command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-install-vr9tudgo/dotenv/setup.py'"'"'; __file__='"'"'/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-install-vr9tudgo/dotenv/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-pip-egg-info-s52onefd cwd: /private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-install-vr9tudgo/dotenv/ Complete output (52 lines): WARNING: The wheel package is not available. ERROR: Command errored out with exit status 1: command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-wheel-5abq7b_z/distribute/setup.py'"'"'; __file__='"'"'/private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-wheel-5abq7b_z/distribute/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-pip-egg-info-wt2t_6up cwd: /private/var/folders/8d/qfyvf5xx2ng32l9n01xp0y0m0000gn/T/pip-wheel-5abq7b_z/distribute/ Complete output (15 lines): Traceback (most recent call last): File "