Reputation: 3
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?
Upvotes: 0
Views: 294
Reputation: 1967
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.
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)])
Upvotes: 1