Python install in 2 lines @Windows

Command to execute

Open cmd as administrator and paste the following command

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

#Paste ↓ when ↑ processing is completed

choco install -y --execution-timeout=1000000 anaconda3

that's all!

The contents of the command are explained below.

environment

Explanation of "command to execute"

The seeds are "chocolatey" and "anaconda". If you're already using chocolatey, you don't need the command on the first line. ** Since June 2016, you can install anaconda with chocolatey **, which is the reason why I wrote this article.

Line 1: chocolatey installation

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

Installation of package manager "chocolatey"

After installing it, on a command prompt opened with administrator privileges

chocolatey install <package name>

You can easily install the software with just this.

There are also many famous software such as Google chrome and iTunes.

Official → chocolatey

Chocolatey packages

More details → Notes on building an environment using Chocolatey

Line 2: Anaconda installation

choco install -y --execution-timeout=1000000 anaconda3

Install python distribution "anaconda" using chocolatey

What is anaconda ...

Official → anaconda3

Chocolatey Package Collection: Anaconda Page

More details → Python environment construction for those who aim to be a data scientist 2016

-y

The -y option is synonymous with answering'yes' to all the questions chocolatey asks.

When it is troublesome to type y one by one, it is easier to specify it first so that you do not have to stick to the screen.

About timeout

If you do not specify the --execution-timeout option, you will get this error after downloading for about 30 minutes.

     --timeout, --execution-timeout=VALUE
     CommandExecutionTimeout (in seconds) - The time to allow a command to 
       finish before timing out. Overrides the default execution timeout in the 
       configuration of 2700 seconds.

The installer is too large and the default chocolatey time times out.

I've spent a lot of wasted time, so let's specify it in advance.

By the way, please note that it takes 1-2 hours from download to installation.

Package update

Updated all software managed by chocolatey

choco upgrade all -y

When updating a chocolatey package, choco upgrade <package name>

Specifying as ʻall` updates all packages installed by choco.

By the way, the choco update command is still available, but it seems to be abolished. (Warning comes out)

Updated all anaconda packages

conda update --prefix C:\tools\Anaconda3 --all 

When updating, conda update <package name>

When installed by chocolatey, it is not created in the home directory (under C: \ Users \ <UserName> or under C: \) like when installing with anaconda by default. Therefore, specify the location of anaconda with --prefix <path>.

Recommended Posts

Python install in 2 lines @Windows
Windows10: Install MeCab library in python
Install Python (for Windows)
Install Python 3.5.1 + numpy + scipy + α in Windows environment
[Python 3] Prime factorization in 14 lines
How to install Python [Windows]
Install watchdog on Windows + Python 3.3
Install Python and Flask (Windows 10)
Windows10: Install python dlib library
[Python] [Chainer] [Windows] Install Chainer on Windows
Install dlib for Python (Windows)
[Python] Show multiple windows in Tkinter
Put MeCab in "Windows 10; Python3.5 (64bit)"
Install python2.7 on windows 32bit environment
Install xgboost (python version) on Windows
Install Python on Windows + pip + virtualenv
Install Pytorch on Blender 2.90 python on Windows
install tensorflow in anaconda + python3.5 environment
I can't install scikit-learn in Python
Make python segfault in three lines
Install Python development environment on Windows 10
[Python Windows] pip install with Python version
Python in optimization
CURL in python
Mouse operation using Windows API in Python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
Install Pyaudio to play wave in python
Meta-analysis in Python
Python on Windows
Unittest in python
[Kivy] How to install Kivy on Windows [Python]
Line graphs and scale lines in python
Epoch in Python
Discord in Python
Python installation (Windows)
Install Python locally
Sudoku in Python
DCI in Python
[Python] [Windows] Take a screen capture in Python
quicksort in python
nCr in python
Install easy_install (Windows)
N-Gram in Python
Programming in python
Install NAOqi python
Plink in Python
Constant in python
Lifegame in Python.
FizzBuzz in Python
StepAIC in Python
Install Python Control
N-gram in python
Csv in python
Disassemble in Python
Reflection in Python
Manage python packages to install in containers
Constant in python
nCr in Python.
format in python