I have got a Windows7 system, and I installed on it a Virtual Box 5.1.26.
On this virtual box, I installed a Debian64 - Linux server. (I think I configured it correctly, it is getting enough memory).
When I want run a Python script on it (which is a web-scraping script, it process around 1000 pages and take it into database), i get always the same error message after a few minutes :

Unable to allocate and lock memory. The virtual machine will be paused. Please close applications to free up memory or close the VM.
Or something error message with : run out of time (when it want to load a website)

In the windows7 system my script is working without any problem, so I am a little bit confused now, what is the problem here?
First check the parameters of your virtual machine you might have given it much more RAM or processors than you have (or not enough).
If this is not the case close everything in the VM and only start the script.
These errors generally say that you don't have resources to perform the operation.
Check if your syntax is ok and if you are using the same version of python on both systems.
Note that the VM is a guest system and can't have as much resources as your main OS because the main Os will die in some circumstances.
How to run a python script successfully with a debian system on the VirtualBox?