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.

No problem, @3rdOfJuly, it's enabled for you.

Hi, could you please turn on the new virtualization system for me as well? Thanks a lot

No problem. I have enabled it for your account.

Hello, could you please turn on the new virtualization system for me as well? Thanks a lot

It appears to be already enabled for your account.

Hi, could you upgrade new virtualization system for me?

Hi, can you please upgrade me to the new virtualization system as well? Thank you :)

Right now we're in the process of enabling the new virtualization system for everyone; the first step has been to have it on by default for new accounts -- then we'll be upgrading existing accounts in batches.

This means that:

  • @erikkostashuk -- you already have the new virtualization system, so you just need to follow the instructions in my earlier post to use it.
  • @merttsdmr -- I've made a note to make sure that you're in one of the first batches of existing accounts to be moved over to it. We'll let you know when that has been done for your account;

@merttsdmr It's done for you

Hello,

Please activate headless Chrome on my account.

I've made a note to make sure that you're in one of the next batches of existing accounts to be moved over to it. We'll let you know when that has been done for your account;

Hi, could you upgrade new virtualization system for me?

Sure, I've made a note to enable it in one of our next batches. We'll post here to let you know when it's done.

One extra thing: would this be for you to use headless Chrome? If so, you'll also need to upgrade to the most recent system image to get it working once the new system is enabled for you.

It is done

I tried to use your code above, but return error "selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH."

If i add chromedriver separately in its own directory then error "selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions."

All this I started to do due to the fact that using the FireFox with Display also ended up with an error "selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details."

What changed? What should we do?

Hi @ferettimotorsrussuian, as Giles said before, it will be enabled for you in one of our next batches -- we'll let you know then it's done.

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

Sure, I've made a note to enable it in one of our next batches. We'll post here to let you know when it's done.

Glenn, does it mean that I can already use it?

When will you do the next batch?

We have not planned when the next batch will be.

Is it possible to enable it to me manually as there is not date for the next batch? I just finished my project and I really need to deploy it. Unfortunately there is no way to deploy it using firefox 17

It's not possible for us to do it outside of when we do the next batch.

How often are updates?

It depends on various factors which are related to how our system works internally, so we can't answer that it is "every few days" or so, because it may not work for everybody in the same way. We are queueing the requests though, so the general rule is that it works like a FIFO but not always :)

Hm, really? If I create a new account, will chrome work on it? Or I will have to wait for your free time? We have been waiting for a week

yes- for a new account, you will automatically have the new features.

@developertexteditor -- that's done for you now; see my previous post for the next steps.

@ferettimotorsrussuian -- unfortunately due to certain features of your account, you'll have to be in a later batch, but don't worry -- we've not forgotten you!

@giles I just create new account or use other VPS server, we think now.

@ferettimotorsrussuian It's done for your old account.