How to run the python script

I got error with the python /usr/… path for python not found. I realized we need to install it with sudo.

from inside your vagrant run:
sudo apt-get install python-psutil

@ jumuma

If your original Vagrant installation completed successfully, you should not have to do this. You don’t mention which Python script you were attempting to run, but Python should be installed and accessible on your vm if everything went correctly. Did you try running python --version before running this command?

vagrant@m312:/shared$ ./ --port 30000
Traceback (most recent call last):
File “./”, line 99, in
File “./”, line 85, in main
collection.drop() # Drop the collection to start fresh
File “/usr/local/lib/python2.7/dist-packages/pymongo/”, line 1103, in drop
dbo.drop_collection(self.__name, session=session)
File “/usr/local/lib/python2.7/dist-packages/pymongo/”, line 914, in drop_collection
with self.__client._socket_for_writes(session) as sock_info:
File “/usr/local/lib/python2.7/dist-packages/pymongo/”, line 1267, in _socket_for_writes
server = self._select_server(writable_server_selector, session)
File “/usr/local/lib/python2.7/dist-packages/pymongo/”, line 1254, in _select_server
server = topology.select_server(server_selector)
File “/usr/local/lib/python2.7/dist-packages/pymongo/”, line 231, in select_server
File “/usr/local/lib/python2.7/dist-packages/pymongo/”, line 189, in select_servers
selector, server_timeout, address)
File “/usr/local/lib/python2.7/dist-packages/pymongo/”, line 205, in _select_servers_loop
pymongo.errors.ServerSelectionTimeoutError: No replica set members available for replica set name “m312RS”
vagrant@m312:/shared$ Connection to closed by remote host.
Connection to closed.

Hi @Dhamodharan_23277,

The possible reasons for this error can be:

  1. The localhost is not mapped to the correct IP You can check the mapping in /etc/hosts file.
  2. Also, check that your M312rs replica set is up and the primary is available for the replica set.

Please check for the above mentioned points. Meanwhile, I will get back to you with more information on it.

Please let me know, if you have any question.