Ganesh Kathiresan
Ganesh Kathiresan

Reputation: 2088

Upgrading python on Windows 10’s Bash Shell

I was trying to update python3 in the Linux Bash Shell for Windows 10.

Here is what I tried:

sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6

But I got the following error:

Processing triggers for libc-bin (2.19-0ubuntu6.9) ...
Errors were encountered while processing:
 ghc
E: Sub-process /usr/bin/dpkg returned an error code (1)

I also tried searching if it will override my python 3.4 and make it inaccessible as in delete it and install 3.6, but found no results.

Is there a safe way to upgrade python3 here

[EDIT]

After upgrading the shell to 16.04 using do-release-upgrade, the error goes away. Update can be done following this link.

Upvotes: 10

Views: 13909

Answers (2)

Rich Turner
Rich Turner

Reputation: 10984

First, I'd strongly encourage you to make sure you're running Windows 10 Fall Creators Update (or later).

Secondly, I'd recommend adding the apt upgrade step below:

sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt update
sudo apt upgrade
sudo apt install python3.6

The upgrade step ensures that all your installed packages are upgraded to their latest version, and can often fix "errors while processing" other packages' installation.

Upvotes: 1

Some dude
Some dude

Reputation: 587

That's a weird error, there might be something wrong with your dpkg. You can always try building python from source. This works in regular out-of-the-box Ubuntu, so it should run on Windows too.

sudo apt-get install zlib1g-dev
wget www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar -xf Python-3.6.0
cd Python-3.6.0
./configure --enable-optimizations
make
sudo make install

Save those commands to a file called python.sh, then run

chmod 755 python.sh
./python.sh

It can take a while, though, so be patient

Upvotes: 0

Related Questions