Search code examples
pythonpipmasonite

Command 'key' is not defined when running craft install


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


Solution

  • 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