Nama/swayrst

Installing through pip: package directory does not exist

Closed this issue · 1 comments

I made a PR to fix this earlier, but it had it's own problems so I'm making an issue instead (as directed).

When I run pip install ., I get this error:

Defaulting to user installation because normal site-packages is not writeable
Processing /home/jsimonrichard/sway-workspaces
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [7 lines of output]
      running egg_info
      creating /tmp/pip-pip-egg-info-gntbtofq/sway_workspaces.egg-info
      writing /tmp/pip-pip-egg-info-gntbtofq/sway_workspaces.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-pip-egg-info-gntbtofq/sway_workspaces.egg-info/dependency_links.txt
      writing top-level names to /tmp/pip-pip-egg-info-gntbtofq/sway_workspaces.egg-info/top_level.txt
      writing manifest file '/tmp/pip-pip-egg-info-gntbtofq/sway_workspaces.egg-info/SOURCES.txt'
      error: package directory 'sway_workspaces' does not exist
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I believe this is because, when the packages option is used, pip expects a folder called sway_workspaces with an __init__.py folder, not a file called sway_workspaces.py. Instead, and individual python module could be specified using the py_modules option (https://docs.python.org/3/distutils/setupscript.html#listing-individual-modules).

Nama commented

You are correct. I made a proper package folder and updated everything accordingly. Should work now.