LoginSignup
0
1

More than 3 years have passed since last update.

Python環境準備(venv初めて使う)

Last updated at Posted at 2020-07-05

自分用メモ2です

Python環境づくり
会社で使っているPCはうまくいっていたAnacondaで
家のPCの環境作りをやろうとしたらうまく動かなかったので別の方法をトライ

Windows10 home


python インストール

~Windows x86-64 executable installer
を落としてインストール

今日はVer.3.7.7にしてた

PATHは通し忘れたのでシステム環境変数のPATHに
C:~\Python\Python37
C:~\Python\Python37\Scripts
の2つを追加した


仮想環境 venvを使う

PowerShellで作業した

参考URL様

https://qiita.com/fiftystorm36/items/b2fd47cf32c7694adc2e
https://docs.python.org/ja/3/library/venv.html

保存したい先へ移動

cd 環境を作るフォルダ

名前を決めて環境作り→勝手に環境名のフォルダができる

python -m venv 環境名

アクティベート→ここで詰まる

.\環境名\Scripts\activate

「このシステムではスクリプトの実行が無効になっているため」
とかなんとかでアクティベートできない

参考URL様

https://toypool.hatenablog.com/entry/2019/02/08/142824
https://qiita.com/ryu22e/items/520b35db6a444d8289da

上記にならって管理者権限でPowershellを起動しなおして

Set-ExecutionPolicy RemoteSigned

Yesで進める

再度アクティベートでうまいこと完了

.\環境名\Scripts\activate

Powershellの表示が
(環境名) ~
に変わったのでたぶんOK

あとはpip install ***で色々揃えればいいのかな?
Visual studio codeでは作った環境のPythonに選びなおしたらうまく動いた


今日入れたモノ

numpy
opencv-python
pyrealsense2
open3d-python
pandas
matplotlib
seaborn
bokeh

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