0

I have written a Python Scraper with Selenium and in that I have to tackle the 2FA,so, I am prompting for the user input to get the code and move forward, everything is working smoothly in local machine and the whole script is executing correctly and providing the desired output.

Now, as I have deployed the Application to Ubuntu Server on Linode machine, the pymsgbox is not opening on the server and I am getting the following error,

couldn't connect to display "127.0.0.1:0.0"

I downloaded the library from the following command,

sudo apt-get install python3-tk

I have tried all the possible solutions whether that is on Stackoverflow, superuser, reddit, ASK etc but not working.

Please let me know if I am missing something.

Hamza Khan
  • 1,321
  • 11
  • 15
  • You're not going to be able to run this on a server. Tkinter requires a display. – Bryan Oakley Feb 09 '21 at 21:32
  • Does your server have a graphical desktop environment? – acw1668 Feb 09 '21 at 23:35
  • @BryanOakley So, What should we do on the Production server, should we deploy on Window Server or should we install Graphical Desktop on Linux. – Hamza Khan Feb 12 '21 at 20:27
  • What do you expect to happen when someone connects to the server? Are you expecting them to see a tkinter window? That's not going to be easy, as tkinter simply isn't designed to work on a server. It's not impossible, but you are likely going to have to do a _lot_ of work to make it happen. – Bryan Oakley Feb 12 '21 at 20:39
  • It should show a message box asking for some using input and on the basis of that user input, it should proceed with the further processing. – Hamza Khan Feb 13 '21 at 10:50

0 Answers0