Python conf not found

I am doing a project involving json modules in python. The line “import conf,json,time” gives error. I need correct syntax and do I need to import or install any packages to implement the above line?

Please share the screenshots of the code and error

Have you already installed json? if yes, the problem might be the directory, the conf.py file and the file in which you are importing it should be in the same directory.
Set your credentials in the conf.py file and then import it in a new file. This might work.

The content of the conf.py file should be as follows:

SID = ‘You can find SID in your Twilio Dashboard’
AUTH_TOKEN = ‘You can find on your Twilio Dashboard’
FROM_NUMBER = ‘This is the no. generated by Twilio. You can find this on your Twilio Dashboard’
TO_NUMBER = ‘This is your number. Make sure you are adding +91 in beginning’
API_KEY = ‘This is your Bolt Cloud accout API key’
DEVICE_ID = ‘This is the ID of your Bolt device’

You have to create a python file named conf.py and the contents of the file have to be:–
SSID = ‘You can find SID in your Twilio Dashboard’
AUTH_TOKEN = ‘You can find on your Twilio Dashboard’
FROM_NUMBER = ‘This is the no. generated by Twilio. You can find this on your Twilio Dashboard’
TO_NUMBER = ‘This is your number. Make sure you are adding +91 in beginning’
API_KEY = ‘This is your Bolt Cloud account API key’
DEVICE_ID = ‘This is the ID of your Bolt device’

Save the file and then import this conf.py file using the command “import conf” in your project.
If the error still persists then make sure you have installed json if not you can run this “sudo apt-get install -y php-json” command in your terminal.

If it helps please do respond! @sainath2k20

@sainath2k20 Make sure you name your folder “conf.py” making sure all the letters are in lower case.
Also make sure your conf.py and other .py files exist in the same folder.
If this doesn’t work reply back with the snapshot of error message.

Hi.You need to first create a “conf.py” file using “sudo nano conf.py” on your ubuntu server. This will have your SID,AUTH_TOKEN,NUMBER,API_KEY…(Basically all your credentials must be stored in it).
Second , you create another file in which you import conf, json and time.
Make sure that the name of your file containing your credentials matches with what you are importing in the second one.
Also, do check if your codes are well written in places where you are typing “conf”.
Hope it helps! :slight_smile:

hello @sainath2k20 please check the directory first you are in. If you feel you are in a correct directory then give the command “ls” command there you can see the list of files in the directory
if you cannot find the conf.py file there , Use “cd” file to move to the file location.If want to know the location where you have saved , you can use “ls -a” or “ls -l” command.
Before that please check whether you have created using the file using the name “conf.py”.

you should create the conf.py file in the same directory you are working in.