LoginSignup
16
23

More than 5 years have passed since last update.

Windows10環境でAnaconda、Pycharmインストール・設定トライ(1)

Last updated at Posted at 2018-05-01

Python学習には、最初はIDLE → 慣れてきたらPycharm使用が良いとの記事あり。

https://gammasoft.jp/python/python-development-environment/
GAMMASOFT
ホーム> Pythonで仕事を自動化するには> プログラミング
Pythonの開発環境について(IDLEとPyCharm)
当社が普及を推進している「Pythonで仕事自動化」において、推奨している Python の開発環境は以下の2つです。
 ・IDLE(Pythonに付属)
 ・PyCharm(Community Edition:無償版)
まずはIDLEでプログラミングをすぐに始める
慣れたらPyCharmに乗り換える


IDLEに慣れてきたところで、Anaconda、Pycharmインストール・設定トライ


  1. Anacondaインストール

参考サイト

Anaconda を利用した Python のインストール (Windows)

1.1 Anaconda のダウンロード
Anaconda のダウンロードページから、Python 3.5 の 64 bit のインストーラをダウンロード。2018/4
https://www.anaconda.com/download/#_windows
Anaconda 5.1 For Windows Installer
Python 3.6 version *
64-Bit Graphical Installer (537 MB)

1.2 Anaconda のインストール
・ダウンロードしたファイルを開き、インストーラを起動。
「Next」を押して次に進む。
・ライセンスを確認し、「I Agree」を押して次に進む。
・「Just Me」を選択されていることを確認し、「Next」を押して次に進む。
・インストール先を尋ねられるので、「Next」を押して次に進む。
・2 つのチェックボックス (環境変数 PATH への設定、Python 3.5 をデフォルトの Python として登録) にチェックが入っていることを確認し、「Next」を押して次に進む。
 注) Add Anconda to my PATH environment variable(環境変数 PATH への設定)は、Not recommended ...と赤字表示されるが、チェックを入れたほうが便利。
 コマンドプロンプトを起動したとき、何処のディレクトリでもpythonを実行できる。
 なお、インストール時Anaconda Promptなるものが作成されるので、ここで作業する限り、ディレクトリを移動しなくても良いだが。

・インストールが始まる。
・Install microsoft VSCcode→Skip
・Finish」を押し、インストーラを閉じる。

1.3 Windows標準コマンドプロンプト起動
Add Anconda to my PATH environment variable(環境変数 PATH への設定)にチェックを入れてインストールした場合、何処のディレクトリでもpythonを実行できる。

プロンプト起動

Microsoft Windows Version 10.0.16299.371 2017 Microsoft Corporation. All rights reserved.

C:\Users...-pc>

Python起動

C:\Users...-pc>python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
'>>>'

Python起動した、OK!、exit()する。
'>>>' exit()

C:\Users...-pc>

1.4 Anaconda Prompt 起動

Anaconda Prompt を起動する
「スタートボタン」 ⇒ 「すべてのアプリ」 ⇒ 「Anaconda Prompt」 を選択する。

(base) C:\Users...-pc>

1.5 pip のアップグレード

(base) C:\Users...-pc>python -m pip install --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py2.py3-none-any.whl (1.3MB)
100% |????????????????????????????????| 1.3MB 1.6MB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Successfully installed pip-10.0.0
(base) C:\Users...-pc>

再度やってみる。
(base) C:\Users...-pc>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\suga-pc\anaconda3\lib\site-packages (10.0.0)

OK!もう良し。

1.6 pip コマンドのオプション
pip --help コマンドを実行すると、アンインストールなど、pip コマンドを利用して可能な操作が一覧表示される。

(base) C:\Users...-pc>pip --help

Usage:
pip [options]

Commands:
install Install packages.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
check Verify installed packages have compatible dependencies.
config Manage local and global configuration.
search Search PyPI for packages.
wheel Build wheels from your requirements.
hash Compute hashes of package archives.
completion A helper command used for command completion.
help Show help for commands.

General Options:
-h, --help Show help.
--isolated Run pip in an isolated mode, ignoring environment variables and user configuration.
-v, --verbose Give more output. Option is additive, and can be used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output. Option is additive, and can be used up to 3 times (corresponding to
WARNING, ERROR, and CRITICAL logging levels).
--log Path to a verbose appending log.
--proxy Specify a proxy in the form [user:passwd@]proxy.server:port.
--retries Maximum number of retries each connection should attempt (default 5 times).
--timeout Set the socket timeout (default 15 seconds).
--exists-action Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup,
(a)bort).
--trusted-host Mark this host as trusted, even though it does not have valid or any HTTPS.
--cert Path to alternate CA bundle.
--client-cert Path to SSL client certificate, a single file containing the private key and the
certificate in PEM format.
--cache-dir Store the cache data in .
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine whether a new version of pip is available for
download. Implied with --no-index.
--no-color Suppress colored output

(base) C:\Users\ >

Anacondaインストール無事終了。

C:\user>コンピューター名\Documents\Python Scripts
が生成されている。
Pythonで作成したコードを入れるフォルダーが用意されている。

一応、環境変数・pathチェックしてみる。
コントロールパネル→システムとセキュリティ→システム→システムの詳細設定を順にたどって、環境変数設定表示。
(コンピューター名)ユーザ環境変数 → pathへ
下記path設定あり。
C:\Users(コンピューター名)\Anaconda3・・・ここにpython.exe
C:\Users(コンピューター名)\Anaconda3\Library\mingw-w64\bin
C:\Users(コンピューター名)\Anaconda3\Library\usr\bin
C:\Users(コンピューター名)\Anaconda3\Library\bin
C:\Users(コンピューター名)\Anaconda3\Scripts
python.exeがあるpathも設定されており、コマンドプロンプトが何処のディレクトリでもpythonを実行可能であることが分かる。

なお、Python統合開発環境IDLEは、
C:\Users(コンピューター名)\Anaconda3\Scripts\idle.exe
にあり、ショートカットを作っておくと便利。

idle.exe起動で、
Python 3.6.4 Shell起動画面

File>New Fileで
UntitltedのPythonコード開発画面

次、PyCharmにトライ。

https://qiita.com/suJiJi/items/c0fe298969b4cdf569d9
Windows10環境でAnaconda、Pycharmインストール・設定トライ(2)

16
23
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
16
23