Runing python in a VM

trevor1940
trevor1940 used Ask the Experts™
on
Hi I need to test a python script

Are there any Virtual Machines available that has python pre-installed
if not What would be the best OS to run Python

It would need to run on Win 10 host with access to host  HDD & the internet
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2017

Commented:
IT is not a huge undertaking if it is not install to get it added.
there is a python for windows 10
https://www.python.org/downloads/windows/

get virtualbox install any linux. are you comfortable with command line or you prefer GUI based?
Linux mint, ubuntu desktop, etc.
From the host you control what the guest can access.
VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017
Commented:
Don't run Python on Windoze!

Download and Install Ubuntu 18.04 LTS, install the OS in a VM, and then install Python.

and you didn't ask which version 2.x or 3.x

Author

Commented:
Im comfortable with command line  just a bit rusty

get VirtualBox install any linux.

I've attempted that under win 7 and had quite a job getting  guest additions working hence why I asked if any VM's available that are pre built with the OS

Python 2.7 or Python 3.5+ under CPython
I'm guessing this is unix

Also assuming python will instal via yum? or do you have to compile it?
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
Python under Windoze is a nightmare!!!! It;'s a hack and slash job!

Install Ubuntu 18.04 in a VM, and then just use

sudo apt-get install python

Open in new window


Don't be tempted to download VMs others have created you do not know what is lurking inside, download the ISO from Ubuntu and install yourself, it's just next, next, next....restart
Distinguished Expert 2017

Commented:
Yum, apt-get depending on which Linux distro you install.
Commonly, Python is not included by default.
You could during the setup whether you use a complete download ISO, or use a net-boot type option.

The virtualization issues you may have had relied on the hardware versus Windows 7
I.e. Whether the processor had virtualization as well as whether it is enabled through the bios.

Issues from before not whitstanding, install virtualbox, pick one distro and try it.
If you run into issues, create a related question to this one which will alert the participants of your new question .

Author

Commented:
OK I will install VMware in the  morning then Ubuntu

Is there anything I need to know in terms of configuration so the  VM & Host PC play nice?
Andrew Hancock (VMware vExpert / EE Fellow)VMware and Virtualization Consultant
Fellow 2018
Expert of the Year 2017

Commented:
no need to use VMware Workstation, unless you prefer it, Virtualbox is fine.

Just set basic requirements for your VM, and don't go crazy on the config, e.g. GB of RAM!!!
nociSoftware Engineer
Distinguished Expert 2018

Commented:
You only need GuestAdditions IF want integration with the desktop. It can run without.

Python is used by a lot of tooling on Unix. So almost all distro's have packages for it ans also for some core products.
Many have it installed by default as some of the core components of installers for distro's are written in python.
(CentOS (yum has been written in python), Gentoo (portage has been written in Pyton) )
Had to adjust BIOS setting to enable virtualization as per here

Installation of Ubuntu keep hanging
Distinguished Expert 2017
Which ubuntu desktop/server did you get.
See if linuxmint
Hanging at what stage/point?
ubuntu 18.4 sudo apt-get install python

Where it asks to update during install had to kill a couple of time pic is after about an hour using default settings
BTW it's got 4gb ram

ubunbtu.jpg
nociSoftware Engineer
Distinguished Expert 2018
Ok the system clearly needs MORE memory. outof memory killer is the kernel complaining about lack of memory to run processes in.
4GB of memory if 3.5GB of memory is assign to processes then  you effectively have 0.5GB free for these task.
Distinguished Expert 2017
Give vim 512m 1g should be enough
Got it working my upping memory & stopping other task on host
Python 3.5  pre installed but can't  get script to run so will post new question
Installing a VM just to run python is kind of silly.
Python works perfectly well on Windows 10.
Use Windows, unless the requirements are to run the python script specifically on linux.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial