初めに
Django-admin startprojectで表題のエラーで苦戦したため、その備忘録を残しておきます。経験はまだまだ浅いため、間違っていたらごめんなさい。
環境
- MacOS 10.15
- python3.7
- Django3.0
対処法
$ python3 -m Django-admin startproject mysite
パスを通してないとできないかもです。
「python3」、自分の環境に合わせて「python」とかに変えてください。
特に何もしてないと、python→Python2系、python3→Python3系だと思います。
たぶん公式のコマンドのままだとPython2系を使ってるのかな?
以下に問題解決の時に参考にしたページを載せています。
Django公式トラブルシューティング:
https://docs.djangoproject.com/ja/3.0/faq/troubleshooting/
Macを最近使い始めたので、個人的にはPython3のインストールディレクトリを探していろいろするのが辛かったです。
皆さんも頑張ってください!