0
1

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 5 years have passed since last update.

pythonで使うコマンドをまとめる

Last updated at Posted at 2019-09-23

pythonでよく使うコマンドをまとめる

調べる系

pythonのバージョンを調べる

$python --version

pythonのインストール先を調べる

$which python

venvによる仮想環境の作成

Homebrewを使って仮想環境を作成する。
仮想環境を作成するディレクトリで実行する。

venvによる仮想環境の作成・有効・無効

`仮想環境の作成`
$python -m venv `仮想環境`

`仮想環境を有効化`
$ source 仮想環境/bin/activate

`仮想環境を無効化`
$ deactivate

ライブラリのインストール

pipを使ってインストールする

`インストール`
$pip install インストールするライブラリ

`仮想環境に何をインストールしたかを確認`
$ pip freeze -l

`インストールしたライブラリのアップデート`
$ pip list -o | awk '{print $1}' | xargs pip install -U

参考

・【2019年版】Pythonインストール・Mac編【長く安全に使える環境構築】(https://basicincome30.com/python-install-mac)

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?