Fabric icon indicating copy to clipboard operation
Fabric copied to clipboard

Problems with install

Open BosenSwe opened this issue 1 year ago • 4 comments

What happened?

I use 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux

I created a conda enviorment with: conda create -n "fabric" python=3.11 ipython I cloned the repo: git clone https://github.com/danielmiessler/fabric.git I installed pipx: sudo apt install pipx I cd into fabric folder and tried to install: pipx install .

error: subprocess-exited-with-error

Version check

  • [X] Yes I was.

Relevant log output

× Building wheel for fabric (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [39 lines of output]
      Traceback (most recent call last):
        File "/home/bosen/.local/pipx/shared/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/bosen/.local/pipx/shared/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/bosen/.local/pipx/shared/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vjdho4j0/overlay/lib/python3.11/site-packages/poetry/core/masonry/api.py", line 58, in build_wheel
          return WheelBuilder.make_in(
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vjdho4j0/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/wheel.py", line 88, in make_in
          wb.build(target_dir=directory)
        File "/tmp/pip-build-env-vjdho4j0/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/wheel.py", line 124, in build
          self._copy_module(zip_file)
        File "/tmp/pip-build-env-vjdho4j0/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/wheel.py", line 265, in _copy_module
          to_add = self.find_files_to_add()
                   ^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vjdho4j0/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/builder.py", line 223, in find_files_to_add
          if self.is_excluded(
             ^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vjdho4j0/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/builder.py", line 153, in is_excluded
          if exclude_path.as_posix() in self.find_excluded_files(fmt=self.format):
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vjdho4j0/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/builder.py", line 121, in find_excluded_files
          vcs_ignored_files = set(vcs.get_ignored_files()) if vcs else set()
                                  ^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vjdho4j0/overlay/lib/python3.11/site-packages/poetry/core/vcs/git.py", line 340, in get_ignored_files
          output = self.run(*args)
                   ^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vjdho4j0/overlay/lib/python3.11/site-packages/poetry/core/vcs/git.py", line 373, in run
          subprocess.check_output(
        File "/usr/lib/python3.11/subprocess.py", line 466, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.11/subprocess.py", line 571, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['git', '--git-dir', '16:10:10.177636 git.c:460               trace: built-in: git rev-parse --show-toplevel\n/home/bosen/Dokument/git/fabric/.git', '--work-tree', '16:10:10.177636 git.c:460               trace: built-in: git rev-parse --show-toplevel\n/home/bosen/Dokument/git/fabric', 'ls-files', '--others', '-i', '--exclude-standard']' returned non-zero exit status 128.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for fabric
ERROR: Could not build wheels for fabric, which is required to install pyproject.toml-based projects
Cannot determine package name from spec '/home/bosen/Dokument/git/fabric'. Check package spec for errors.

Relevant screenshots (optional)

No response

BosenSwe avatar Jun 08 '24 14:06 BosenSwe

The error message you provided indicates that there was an issue building the wheel for the fabric package during the pipx install . process. The specific error is related to a subprocess call involving Git, which returned a non-zero exit status 128. This means that the git command failed to execute properly. Let's break down the potential causes and solutions:

Potential Causes:

  1. Git Repository Issues: The path /home/bosen/Dokument/git/fabric seems to be part of a Git repository. The error message suggests that there might be an issue with the Git configuration or the repository itself.
  2. Missing Git Directory: The .git directory or some files within it might be missing or corrupted.
  3. Permissions Issue: There might be a permissions issue preventing the git command from executing properly in that directory.
  4. Environment Issue: The environment in which the command is being run might not have the necessary tools or permissions to execute the command.

Solutions:

1. Verify the Git Repository:

Make sure that the path /home/bosen/Dokument/git/fabric is a valid Git repository. You can do this by running the following commands in the terminal:

cd /home/bosen/Dokument/git/fabric
git status

If there are any errors, you may need to fix the repository or re-clone it.

2. Check the .git Directory:

Ensure that the .git directory exists and is not corrupted:

ls -la /home/bosen/Dokument/git/fabric/.git

If the .git directory is missing or corrupted, you might need to reinitialize the repository or re-clone it:

cd /home/bosen/Dokument/git
rm -rf fabric
git clone <repository-url> fabric

3. Ensure Proper Permissions:

Ensure that you have the correct permissions to read and execute the necessary files in the directory:

sudo chown -R $(whoami) /home/bosen/Dokument/git/fabric
sudo chmod -R u+rwx /home/bosen/Dokument/git/fabric

4. Reinstall Dependencies:

Make sure all necessary dependencies for building the wheel are installed. You might need to install or update poetry, pip, or other related tools:

apt-get install build-essential
pip install --upgrade pip
pip install --upgrade wheel
pip install --upgrade poetry
pip install --upgrade setuptools
pipx install numpy
pipx install chroma-hnswlib --include-deps

5. Isolate the Issue:

Try to isolate the issue by running the command manually:

cd /home/bosen/Dokument/git/fabric
git ls-files --others -i --exclude-standard

If this command fails, the error is likely with the Git setup or repository configuration.

mugenyume avatar Jun 08 '24 20:06 mugenyume

In my case, I installed using pip3 install of pipx with Python 3.10. Should work for Python 3.11 also.

conda create -n fabric python=3.10
conda activate fabric
git clone https://github.com/danielmiessler/fabric.git
cd fabric
pip3 install .

SayedNadim avatar Jun 10 '24 02:06 SayedNadim

Hi @BosenSwe: I had exactly the same issue, with the difference, that it referenced to python version 3.12.

The tips from above sadly didn't work. What helped for me, is that I removed the symlinks of the previously installed python versions on my system.

I first show the previously installed python versions: brew list | grep python

Then remove their links: brew unlink [email protected] brew unlink [email protected] brew link --force [email protected]

replace the x.x with the versions you don't want to use - In your case probably 3.11 In my case I unlinked the versions 3.9 and 3.12. Then replace the x.y with the version you want to use. In my case I "link-forced" the version 3.10.

One other thing I did is to uninstall the python version 3.9 with brew brew uninstall [email protected]

After closing and reopening my terminal window I was able to successfully install fabric.

Here the source of the steps described above: https://stackoverflow.com/questions/64362772/switching-python-version-installed-by-homebrew

Creadata avatar Jun 11 '24 19:06 Creadata

The installation went through as stated above. But now the fabric --setup command generates another error: Traceback (most recent call last): File "/Users/username/Library/Caches/pypoetry/virtualenvs/fabric-g2If8-Gu-py3.12/bin/fabric", line 3, in <module> from installer import cli ImportError: cannot import name 'cli' from 'installer' (/Users/usermane/Library/Caches/pypoetry/virtualenvs/fabric-g2If8-Gu-py3.12/lib/python3.12/site-packages/installer/__init__.py)

Creadata avatar Jun 11 '24 20:06 Creadata