0

I am required to use a fresh Mac OS with no libraries unless I can find a way to download pandas using a .py file on the fresh VM. How would I do this on MacOS?

martineau
  • 119,623
  • 25
  • 170
  • 301
spookums
  • 3
  • 4

2 Answers2

1

You will need to have the entire .tar.gz download in order to install the package, not just a single .py file. As described here as well, once you have the .tar.gz, you can unpack it, navigate to the directory, and execute the setup.py file:

python setup.py install

You can get the latest version of pandas here.

Update after comment/update

Check out using subprocess to issue commands.

import subprocess
import sys

version = 0.24.2
package = 'pandas'

subprocess.call(['sudo', sys.executable, '-m', 'pip', 'install', '{}=={}'.format(package, version)])
cwalvoort
  • 1,851
  • 1
  • 18
  • 19
  • I meant something like this (for windows): 'import os cmd = 'sudo pip install pandas' os.system(cmd)' – spookums May 31 '19 at 01:58
0

If you have already installed pip with your python setup, you can download the wheel file of pandas library and install it using pip.

More about it here.

Vishal
  • 96
  • 3