Forums

pyvirtualdisplay not working

Hey, how r u guys ?

I'm trying to use selenium and pyvirtualdisplay on a virtual machine but it always comes with a message like: "from: can't read /var/mail/pyvirtualdisplay"

do u know what i'm doing wrong ?

my config is python 3.5, django 2.1, selenium 2.

my import is: "pip install pyvirtualdisplay" and " from pyvirtualdisplay import Display"

tnks a lot for this !!

Check out this help page -- it has some sample code that you can build on to get this working.

i got this. xdpyinfo was not found, X start can not be checked! Please install xdpyinfo!

It looks like newer pyvirtualdisplay versions do not work on PythonAnywhere. Use pyvirtualdisplay==0.2.1.

thank u but i got this message "Problem loading page" the page is not google

Are you trying to access a page that is not on our whitelist for free accounts?

I'm on a paid account and get the same error "Problem loading page".

Google works fine, but I tried http://www.algolia.net (which is on the white list) and gives the above error.

http://www.nu.nl does work.

http://www.bol.com doesn't work.

Maybe Firefox 17 is denied?

Hi, we could switch you to a new virtualization system that we deployed recently. It works with Chrome in headless mode.

That would be awesome!

I see that you posted on the EU forums too, so I've replied there.

Hi can you update my to the new virtualization system, please?

Sure, no problem -- that's done now. If you want to use Chrome, you'll need to upgrade Selenium for your account -- for example, if you're using Python 3.7, run this in Bash:

pip3.7 install --user --upgrade selenium

...and then you can run Selenium with Chrome using code like this:

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
browser = webdriver.Chrome(options=chrome_options)

try:
    browser.get("https://www.google.com")
    print("Page title was '{}'".format(browser.title))

finally:
    browser.quit()

Thank you!

No problem!

Hi Giles

Could i get an update to the new virtualization system so that I could use chrome as well?

Sure! That's done now. See my earlier post for the next steps.

Hello, what i'm need to upgrade virtualization system? I'm also want to use chrome

It's done for you.

Hi, I would also like an update to the new virtualisation system too, if possible! Thanks!

No problem. I have enabled it for your account.

Hi, same request for an update to the new virtualization system here.

Sure, we have turned that on for you.

Hi, I would also like an update to the new virtualization system too, if possible!

That's done fore you as well.

Hi - could you update my account to the new virtualization system aswell please? Thank you!

Sure! That's done now.

Brilliant - thanks Giles

Hello, could you turn on new virtualization system for me too? I'll be pretty appreciated!

Yes, it's done.

can you update mine to the new virtualization too please? thank you!

No problem. I have enabled it for your account.

Can I also be updated to the new virtualization please? Thank you.

Sure, that's done -- it will be active in any new consoles you start. Websites and tasks will pick it up the next time they are restarted. See my post above for the next steps if you're using Selenium.

Apologies, but I didn't realise that I was posting from my US version account. Can you add it for my EU account? The username is andrewwoods111. Thank you!

Sure! That's done now.

can you update mine to the new virtualization too please? thank you!

Sure! That's done now.

Please add me as well to the new virtualization, thank you!

It's done for you, @Fromagateau.

Hi, will you please update mine to the new virtualization too? THX

No problem, it's done.

I am getting the message below.

xdpyinfo was not found, X start can not be checked! Please install xdpyinfo!

I am using Firefox. Do I also need to go to the new virtualization?

That message is normally just a warning, so you can ignore it. Are you seeing any other indications that your code is having problems?

Hi

I tried the simple code from

https://help.pythonanywhere.com/pages/selenium

I get the same message. In debugging the code, I think the last line that is run is

browser = webdriver.Firefox()

I had this working, but a while ago so not sure what has changed since then.

The xdpyinfo message is just a warning. It does not affect the working of the code.

Thanks, worked it out, Selenium 3 was somehow installed.

OK -- glad to hear you worked it out!

Hello, could you turn on new virtualization system for me too? Thanks a lot

@nh783 It's done for you

Hi! Could you please turn on new virtualization for me too? Using this new virtualization, Could I keep working with Firefox? Thanks in advance.

@corpserules It's done for you

I would like to upgrade to new virtualization please, thank you!

@clubbrb No problem, it's done for you.

Please enable new virtualization system on my account. Thanks

Sure, no problem -- that's done now.

Please enable new virtualization system on my account. Thank

@TempAutomater -- it's done for you.

Hello, I would like to upgrade to new virtualization system on my account please. Thank you!

No problem. I have done that for your account.

Hi can you upgrade my account to the new virtualization system, please?

Sure, no problem -- that's done now.

Hi could you please upgrade my account too? Thanks!

Yes, it's done, @jneronha.

Hi, could you please upgrade my account to the new virtualization system? :)

Sure, we've done that now. Happy holidays!

Hi, could you please upgrade us as well

I see that you asked about this in another forum thread, so I've answered there.

Hi, could my account be upgraded to the new Virtualization System too? I wanted to try and check if this works before I switch to a paid account.

Appreciate it.

@satanicspawn666 It's done for you

I would like to upgrade to new virtualization please. also will that work with python 3.8? thank you!

That's enabled for you now. Yes, it will work fine with 3.8; you just need to replace the "3.7" with "3.8" in the pip command in my post above.

I would like to upgrade to new virtualization please.

@temi95 It's done for you

Hi there,

Can you please upgrade for me as well? thanks :)

@jeroentpl -- I see you contacted us via email as well, so let's keep our conversation there.

I would like to upgrade to new virtualization please

No problem. I have enabled it for your account.

Hi Glenn - still getting the rror: xdpyinfo was not found, X start can not be checked! Please install xdpyinfo! when I run the sample script

As mentioned above by Glenn and Giles -- that's only a warning message that should not affect your code execution. Apart from that message do you see other issues?

Hey guys, I was also wondering if I could be updated. Thanks!

Sure, we have set that up for you

Hello, could I get updated as well please? Thank you!

you are already on that the new virtualization system.

Hi can you please help me switch on new virtualization and get wkhtmltopdf?

Sure, but first we need to upgrade your system image. One word of warning before that -- because changing the system image upgrades a lot of the pre-installed Python packages, any code that you have that relies on those packages might break if it's not compatible with the new versions. Also, because the new image has newer versions of Python, if you have any virtualenvs, you may need to rebuild them. If you're happy to go ahead despite that, just let us know and we'll switch you over.

Hello, could you turn on new virtualization system for me too? Thanks a lot

No problem. I have enabled it for your account.

Hi, I would like to turn on the new virtualization system too.

No problem, @carolinefranco, it's done for you.

Hi, I would like to turn on the new virtualization system too.

@FallenFox It's done for you

Hi, I would like to turn on the new virtualization system too.