Fabric icon indicating copy to clipboard operation
Fabric copied to clipboard

Create an exe installer or write an ultra detailed installation guide for unexperienced windows users [Feature request]:

Open chislerr opened this issue 1 year ago • 7 comments
trafficstars

What do you need?

Fabric looks like incredibly powerful tool but i have errors or issues on almost every installation step and it is just to difficult to understand and deal with something what requires experience in coding etc.

chislerr avatar Jun 02 '24 17:06 chislerr

@chislerr, you don't actually need coding experience to run and use Fabric. For real! On a Windows machine, you can do it in two ways, and both involve simply pasting and executing commands.

Method 1: Using WSL (Windows Subsystem for Linux)

  1. Enable WSL: Open PowerShell as an administrator and run:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    
  2. Update WSL: After restarting your PC, run:

    wsl --update
    
  3. Install a Linux Distro: For example, to install Ubuntu, run:

    wsl --install -d Ubuntu-24.04
    
  4. Set Up Ubuntu: After installation, set up your user and run these commands one by one:

    sudo apt-get update -y
    sudo apt-get upgrade -y
    sudo apt install git -y
    
  5. Install Python, Pip, and Pipx: Run the following commands:

    sudo apt install python3
    sudo apt install python3-pip python3-venv
    python3 -m pip install --user pipx
    
  6. Clone and Install Fabric: Execute these commands:

    git clone https://github.com/danielmiessler/fabric.git
    cd fabric
    pipx install numpy
    python -m pipx install chroma-hnswlib --include-deps
    pipx install .
    fabric --setup
    

Now, everything should work fine.

Method 2: Without Using WSL

  1. Ensure Git and Python Are Installed: Make sure you have both installed on your windows machine.

  2. Run the Following Commands:

    python -m pip install --upgrade pipx
    git clone https://github.com/danielmiessler/fabric.git
    cd fabric
    pipx install numpy
    python -m pipx install chroma-hnswlib --include-deps
    pipx install .
    fabric --setup
    

After following these steps, everything should work fine and you’ll be ready to go.

I hope this makes it easier for you to understand that you don't need coding experience. You just need to know how to operate Linux and execute commands, and the same goes for Windows.

mugenyume avatar Jun 02 '24 22:06 mugenyume

I'd say go with WSL Get a feel of Linux of not already. It also gives you the flexibility to run other programs that isn't just possible on Windows due to package compatiblity etc.

bamit99 avatar Jun 03 '24 10:06 bamit99

Additionally, it's worth noting that if you encounter the following error:

PS C:\Users\User\fabric> pipx install .
Fatal error from pip prevented installation. Detailed pip output can be found in:
    C:\Users\User\pipx\logs\cmd_2024-01-02_10.12.30_pip_errors.log

pip encountered an issue while building the package:
    chroma-hnswlib

Below are some potentially relevant errors from the pip install process:
    error: subprocess-exited-with-error
    error: Microsoft Visual C++ 14.0 or later is required. You can acquire it through the "Microsoft C++ Build Tools" at: https://visualstudio.microsoft.com/visual-cpp-build-tools/

The error message likely indicates a missing dependency: the absence of build tools. Simply follow the provided link, C++ Build Tools, to download and install the required tools. Once Fabric operates smoothly, you can choose to uninstall the C++ build tools if they are no longer needed. Fabric will continue to function flawlessly thereafter. This guidance is specifically for Windows machines.

For Linux machines, execute the following commands to address the same issue:

  1. Update pip: python -m pip install --upgrade pip
  2. Update wheel: pip install --upgrade wheel
  3. Update setuptools: pip install --upgrade setuptools
  4. Install build-essential: sudo apt-get install build-essential

After completing these steps, retry the aforementioned process, which should now execute without any hitches.

mugenyume avatar Jun 03 '24 10:06 mugenyume

Thanks for the response guys.

I still believe that exe file to install fabric without any issues is just most convenient option for windows users.

But I tried @epeuu Method 1 because I thought earlier about trying out linux. And it helped a lot to move forward, although still not without issues and errors. I spent time to research and deal with them and almost finished this hole process but at the and of it when everything seems to look ok i got this error:

fabric: command not found

It shows after I type "fabric --setup" like it was in guide. and because it is not something as common as other issues I don't know what to do next.

chislerr avatar Jun 03 '24 14:06 chislerr

P.S. found out that it doesn't recognize any of commands related to fabric. Like fabric-webui etc.

chislerr avatar Jun 03 '24 16:06 chislerr

okay i just solved all problems i mentioned earlier. Thanks a lot for your help guys, still stay by my point about exe installer tho. It will be too much work and time to put in just to install for the majority of normies. But they still have a lot of potential to help improving this project so Fabric Ai needs exe or very detailed explanation(which is also fine but amount of different potential errors is so huge that i don't really know is it worth it at the end of the day).

Thanks for the help once more.

chislerr avatar Jun 03 '24 16:06 chislerr

@chislerr, If the installation completed without any issues, it's likely that Fabric isn't in your system's PATH, which is why it cannot be found. Try restarting your terminal, as this might resolve the issue. However, the main problem is probably that Fabric is not in the PATH, so the system cannot locate the command.

For Windows, the PATH for Fabric is C:\Users\{username}\.local\bin. Add this directory to your environment variables, then restart your terminal, and it should work fine.

On a Linux machine, after running the command pipx install . and ensuring it completes without errors, run pipx ensurepath to automatically add Fabric to the PATH. Alternatively, you can manually add it to the PATH.

On Linux you can restart shell by executing source ~/.bashrc or source ~/.zshrc if you use zshrc as your default. Once you've done this, close the terminal, open a new one, and execute fabric --setup again. It should work perfectly now.

mugenyume avatar Jun 03 '24 17:06 mugenyume