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

Windows10にてAtomでdjangoの環境を作る

Posted at

背景

会社のPCが入れ替わりになったので。これ書くの3回目。

この文書には前編があります

なのでこちらを参照ください。

virtualenvで仮想環境を作る

virtualenvをインストールする

ここを参考にしました。
https://qiita.com/kaki_k/items/1fff7fefcf26dc4b69bc

pip install virtualenv
コマンドプロンプトで実行してみるとがっつりエラー。
パーミッションがどうのと言ってますね。。。
Could not install packages due to an EnvironmentError: ・・・

これはコマンドプロンプトを「管理者として実行」することであっさり解決しました。

環境を作る

コマンドプロンプトで仮想を作りたいフォルダに移動します。
例えばドキュメントフォルダにenv1という環境を作りたい場合

$> cd C:\Users{ユーザー名}\Documents
$> virtualenv env1

この手順でいけるんじゃないかなと。

アクティベートで躓く

さて、仮想環境に入りたいのですが。。。

仮想作ったフォルダで

$> Scripts¥activate
を実行しても、私はうまくいきませんでした。。。

$> cd Scripts
$> activate
これでうまくアクティベートできました。

仮想環境から抜けるときは

$> cd Scripts
$> deactivate

これですね。

djangoを導入する

djangoを仮想環境にインストールする

env1の中にDjangoをインストールします。
アクティベートの際チェンジディレクトリしている場合は元の仮想環境直下に移動します。
(env1) C:\Users\{ユーザー名}\Documents\env1>pip install django
これでインストール完了です。

後日編集します

djangoは今すぐ使う用事ないので、いったんここまでの作業です。
あとは勉強あるのみ!

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?