0
0

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 1 year has passed since last update.

Pythonの仮想環境構築

Last updated at Posted at 2023-05-24

はじめに

Windows10でPython仮想環境構築した。

VScodeのPowerShellで以下を順に入力

python -m venv .venv
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
.venv\Scripts\activate.ps1

ディレクトリが(.venv)となったことを確認

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

python -m pip install roslibpy
python -m pip install keyboard

ここではroslibpyとkeyboardをインストールした

仮想環境の共有

python -m pip freeze > requirements.txt

これでrequirements.txtにインストールしたパッケージの一覧が作成される

仮想環境の終了

deactivate

もう一度仮想環境に入るとき

以下を入力すればOK

.venv\Scripts\activate.ps1

参考文献

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?