usedispatch / ReadMe-Generator

A CLI tool that automatically generates a comprehensive README file for your project.
MIT License
52 stars 1 forks source link

Various minor install/usage errors #1

Open davidn opened 2 weeks ago

davidn commented 2 weeks ago

I am attempting to install ReadMe-Generator and encountered the following issues while following the README:

  1. On install step 2, running npm install -g repopack I get the following error:

    npm ERR! code EACCES
    npm ERR! syscall mkdir
    npm ERR! path /usr/local/lib/node_modules
    npm ERR! errno -13
    npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'
    npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'] {
    npm ERR!   errno: -13,
    npm ERR!   code: 'EACCES',
    npm ERR!   syscall: 'mkdir',
    npm ERR!   path: '/usr/local/lib/node_modules'
    npm ERR! }
    npm ERR! 
    npm ERR! The operation was rejected by your operating system.
    npm ERR! It is likely you do not have the permissions to access this file as the current user
    npm ERR! 
    npm ERR! If you believe this might be a permissions issue, please double-check the
    npm ERR! permissions of the file and its containing directories, or try running
    npm ERR! the command again as root/Administrator.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/david/.npm/_logs/2024-10-24T17_28_38_731Z-debug-0.log

    I suggest updating the step to either indicate running as sudo or only require a non-global install (the latter being my personal preference, but a bit more work)

  2. On usage step 2, running readme-generator fails with the following error:

    readme-generator: command not found

    It looks like we're missing an install step pip install .

  3. After installing readme-generator, running it fails with the following error:

    Traceback (most recent call last):
    File "/home/david/Projects/ReadMe-Generator/venv/bin/readme-generator", line 5, in <module>
      from readme_generator.__main__ import main
    File "/home/david/Projects/ReadMe-Generator/venv/lib/python3.11/site-packages/readme_generator/__main__.py", line 3, in <module>
      from .cli import main
    File "/home/david/Projects/ReadMe-Generator/venv/lib/python3.11/site-packages/readme_generator/cli.py", line 8, in <module>
      from .generator import ReadmeGenerator
    File "/home/david/Projects/ReadMe-Generator/venv/lib/python3.11/site-packages/readme_generator/generator.py", line 11, in <module>
      from . import logger
    ImportError: cannot import name 'logger' from 'readme_generator' (/home/david/Projects/ReadMe-Generator/venv/lib/python3.11/site-packages/readme_generator/__init__.py)

    It looks like you are missing the __init__.py file in the src/logger directory needed to make pip install pick up that package. When I add an init file with from .logger import * it works. (You could also move logger/logger.py to logger/init.py)

mainnebula commented 2 weeks ago

Thanks for raising this issue! @davidn

I've pushed some changes to address them. Please let me know if this resolves it for you!!

davidn commented 2 weeks ago

Install works perfectly now! When I run I get the following error:

Traceback (most recent call last):
  File "/home/david/Projects/ReadMe-Generator/.venv/bin/readme-generator", line 5, in <module>
    from readme_generator.__main__ import main
  File "/home/david/Projects/ReadMe-Generator/.venv/lib/python3.11/site-packages/readme_generator/__main__.py", line 3, in <module>
    from .cli import main
  File "/home/david/Projects/ReadMe-Generator/.venv/lib/python3.11/site-packages/readme_generator/cli.py", line 8, in <module>
    from .generator import ReadmeGenerator
  File "/home/david/Projects/ReadMe-Generator/.venv/lib/python3.11/site-packages/readme_generator/generator.py", line 11, in <module>
    from . import logger
  File "/home/david/Projects/ReadMe-Generator/.venv/lib/python3.11/site-packages/readme_generator/logger/__init__.py", line 1, in <module>
    from .logger import error, success, warning, get_progress, console 
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'console' from 'readme_generator.logger.logger' (/home/david/Projects/ReadMe-Generator/.venv/lib/python3.11/site-packages/readme_generator/logger/logger.py)

(Edit: delete a suggested fix which is not sufficient)

mainnebula commented 1 week ago

@davidn I've added some changes to reduce the install friction and updated the install instructions. Let me know if that resolves the issue here!