LoginSignup
0
0

More than 1 year has passed since last update.

Pipenvをインストールし、仮想環境を構築する

Last updated at Posted at 2021-12-22

pythonをインストールする

pyenvを使って、pythonをインストールします。
以下のコマンドを実行します。

pyenv install 3.9.7
pyenv global 3.9.7

pipをアップデートする

以下のコマンドを実行します。

pip install --upgrade pip

Pipenvをインストールする

以下のコマンドを実行します。

pip install pipenv

仮想環境を作成する(コマンドライン)

「application」というフォルダを作成します。
そのあと、作成した「application」フォルダに移動し、以下のコマンドを実行します。

mkdir application
cd applicaiton
pipenv --python 3.8

仮想環境を作成する(PyCharm)

PyCharmを起動します。
「New Project」をクリックします。
スクリーンショット 2021-12-23 6.22.29.png

New Project画面が表示されます。
「Location」に、「applicaiton」と入力します。

「Base interpreter]にPythonの実行ファイルがあるパスを入力します。
「Pipenv executable」にPipenvの実行ファイルがあるパスを入力します。
それぞれのパスは、以下のコマンドを実行し、調べてください。

which python
which pipenv

入力が終わったら、「Create」をクリックします。

スクリーンショット 2021-12-23 6.24.07.png

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