M312-vagrant up is throwing TypeError: 'encoding' is an invalid keyword argument

==> m312: Downloading/unpacking faker
==> m312: Running setup.py (path:/tmp/pip_build_root/faker/setup.py) egg_info for package faker
==> m312: Traceback (most recent call last):
==> m312: File “”, line 17, in
==> m312: File “/tmp/pip_build_root/faker/setup.py”, line 8, in
==> m312: with open(os.path.join(here, ‘README.rst’), encoding=‘utf-8’) as fp:
==> m312: TypeError: ‘encoding’ is an invalid keyword argument for this function
==> m312: Complete output from command python setup.py egg_info:
==> m312: Traceback (most recent call last):
==> m312:
==> m312: File “”, line 17, in
==> m312:
==> m312: File “/tmp/pip_build_root/faker/setup.py”, line 8, in
==> m312:
==> m312: with open(os.path.join(here, ‘README.rst’), encoding=‘utf-8’) as fp:
==> m312:
==> m312: TypeError: ‘encoding’ is an invalid keyword argument for this function
==> m312:
==> m312: ----------------------------------------
==> m312: Cleaning up…
==> m312: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/faker
==> m312: Storing debug log for failure in /root/.pip/pip.log
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

have seen this in another thread…which worked for me

The lib faker dropped support of Python 2.7. Therefore you have to fix compatible version in provision-m312:
function install_python_dependencies(){
sudo apt-get install -y python-dev
sudo apt-get install -y python-pip
sudo pip install pymongo
sudo pip install docopt
sudo pip install faker==3.0.1
sudo pip install psutil
sudo pip install mtools==1.5.3
}

2 Likes

Very good! :+1: I was just about to reply but got distracted.