Command 'key' is not defined when running craft install

419 Views Asked by At

I'm trying to create a new Masonite project and I'm getting this error when running $ craft install

Command "Key" is not defined

I had installed the masonite-cli using pip not pip3

1

There are 1 best solutions below

2
On BEST ANSWER

This usually happens for several reasons. Either the project was not fully installed properly

  • Did you run craft install?

Or your craft version is installed globally incorrectly

  • Did you use pip (with points to Python 2.7) and then create a virtual environment using Python 3?

To fix this typically requires uninstalling craft (pip uninstall masonite-cli) globally and either reinstalling with pip3 or installing it only within your virtual environment.

try running something like:

$ pip uninstall masonite-cli
$ pip3 install masonite-cli

And then activating your virtual environment and checking if it works OR

$ pip uninstall masonite-cli
$ source venv/bin/activate # activate virtual environment
(venv)$ pip install masonite-cli # inside your virtual environment