1
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PythonをMiniconda環境で使おう

Last updated at Posted at 2021-07-23

PythonをMiniconda環境で使おう

これやったらとりあえずPythonでプログラミングを試せます。
シンプルに。実際のコーディングや動作はJupyter labの記事に記載します。
ここはインストール編です。
環境
● Windows10 64bit
● PC: Surface Go2

Minicondaのインストール

以下のサイトにいってMinicondaをダウンロードしてInstallします。
https://docs.conda.io/en/latest/miniconda.html

image.png

パッケージをインストールしよう

Minicondaをインストールしたら各種パッケージを手動でインストールしましょう。
Windowsのスタートから「Anaconda3」から「Anaconda Prompt (install)」をクリック、プロンプト画面を出します。
image.png

インストールコマンド例(ここではjupyterlabをインストール)
: conda install jupyterlab
image.png
ここでProceed([y]/n)?のところに「y」を押してエンターを打ちます。

プロキシの設定

企業内のイントラなどからインターネットにアクセスする場合、多くのケースでプロキシの設定が必要となります。プロキシの設定をしていない場合、上記のconda install $package_nameもHTTPのアクセスエラーで遮断され、Errorが返ってきます。condaの設定ファイルにプロキシの設定をしましょう。これはインストールディレクトリに.condarcファイルを作成して、プロキシの設定を書き込めば完了です。

  1. minicondaのインストールディレクトリにテキストを作る a.txt
  2. a.txtにメモ帳などのアプリでプロキシの設定を記述する
    proxy_servers:
     http: http://proxy.XXXX:PortName
     https: https://proxy.XXXX:PortName

(半角スペースがhttp, httpsの前に入ります。)
3)コマンドプロンプトでファイル名をa.txt から.condarcに変更する
コマンドプロンプト
:ren a.txt .condarc

パッケージのインストール

上記の例のように必要なパッケージを手動でインストールしていきます。

基本パッケージ(おススメ)

numpy : conda install numpy
pandas : conda install pandas
matplotlib : conda install matplotlib
scipy : conda install scipy
jupyterlab : conda install jupyterlab

  • jupyterlabはJupyter notebookの後継。ブラウザベースのエディタ。ケースバイケースですが、個人的には使いやすいエディタ環境の一つ。

グラフ関係

seaborn : conda install seaborn
plotly : conda install plotly

  • plotlyのインタラクティブグラフを使うためにinstallだけではなくextentionの設定も必要(別記事で説明予定)

RPA系、画像系

conda install selenium
conda install -c conda-forge opencv
conda install -c conda-forge pyautogui
conda install -c conda-forge pyperclip
conda install -c conda-forge openpyxl

Jupyter LabでPythonを使ってみる

「Anaconda Prompt (install)」を立ち上げて
: jupyter lab
と入力。Jupyter lab3が立ち上がります。

Pythonを実際に動かしてみるのは、Jupyter Labの記事へ。
https://qiita.com/kisei/items/100fa7496a575a8a8cee

1
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?