UwUMacaroniTime
UwUMacaroniTime

Reputation: 31

Installing python packages on a Chromebook in Visual Studio

I'm trying to install a python package (specifically pandas) into Visual Studio code on a chromebook's linux virtual machine. I've tried many different things but none of them seem to work: trying to use pip install pandas results in bash: pip: command not found. I have no idea where the actual python interpreter is located, so I can't go to the source. I thought it was that I wasn't using the correct terminal, but the only other option is JavaScript Debug Terminal. What am I doing wrong? Is it even possible?

Upvotes: 1

Views: 4781

Answers (3)

cpilko
cpilko

Reputation: 11852

My Chromebook is running Debian and has a managed, minimal Python3 install as a default.

Confirm your distro by opening a terminal and typing cat /etc/issue. If the returned string contains Debian you're good to go with these instructions. Any other distro and your mileage will vary.

You'll need the full version of Python:

sudo apt install python3-full

Pip doesn't work in this environment. Pipx does.

sudo apt install pipx
python3 -m pipx ensurepath  #Adds pipx and the venvs it creates to the path.

Restart your Terminal now to update your path.

You can now install packages one at a time using pipx. (Pipx does not automatically install packages dependencies)

pipx install <package_name> --include-deps

Installing multiple packages in one command (pipx install <p1> <p2>) does not appear to be supported. (But I have 20 minutes experience with pipx right now.)

Upvotes: 0

Matias Soto
Matias Soto

Reputation: 1

You can do:

sudo apt-get install python3-[module you want]

however, this does not work with all modules.

Upvotes: 0

MingJie-MSFT
MingJie-MSFT

Reputation: 9229

Pip is a python package management tool, which provides the functions of finding, downloading, installing and uninstalling Python packages. However, this tool is not included in the system and needs to be installed manually. Here is the official website of PIP, which contains installation instructions.

Upvotes: 0

Related Questions