Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bash: pdoc: command not found #4

Closed
wq2012 opened this issue Jan 22, 2019 · 3 comments

Comments

2 participants
@wq2012
Copy link
Contributor

commented Jan 22, 2019

Expected Behavior

On a Mac or Linux machine,

$ pip3 install pdoc3
$ pdoc --html pdoc

produces documentation.

Actual Behavior

Second command yields:

$ bash: pdoc: command not found

Steps to Reproduce

  1. On a Linux or Mac machine, open terminal
  2. Type the commands
  3. Read the results

Additional info

  • pdoc version:
Python 3.5.4rc1 (default, Jul 25 2017, 08:53:34)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pdoc
>>> print(pdoc.__version__)
0.5.1

Suggestion

Add __main__.py file such that users can at least do:

$ python3 -m pdoc ...
@kernc

This comment has been minimized.

Copy link
Contributor

commented Jan 23, 2019

I'm sorry, I can't reproduce the issue:

$ pip3 install pdoc3
Collecting pdoc3
...
Successfully installed MarkupSafe-1.1.0 mako-1.0.7 markdown-3.0.1 pdoc3-0.5.1

$ which pip3
/usr/bin/pip3

$ pip3 freeze | grep pdoc
pdoc3==0.5.1

$ which pdoc
/home/user/.local/bin/pdoc

$ which pdoc3
/home/user/.local/bin/pdoc3

$ cat $(which pdoc)
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys

from pdoc.cli import main

if __name__ == '__main__':
    sys.exit(main())

As setup.py does specify console scripts, it should be up to setuptools/pip to wire up the executables.

pdoc/setup.py

Lines 39 to 44 in e7868e2

entry_points={
"console_scripts": [
"pdoc = pdoc.cli:main",
"pdoc3 = pdoc.cli:main",
],
},

Have you tried updating pip and setuptools? Do you have any other ideas?

Add __main__.py file such that users can at least do

Would you care to add __main__.py in a pull request?

@wq2012

This comment has been minimized.

Copy link
Contributor Author

commented Jan 23, 2019

Updating pip3 didn't seem to resolve the issue for me. Not sure why.

Anyway, adding __main__.py should make it easier. I've sent pull request. Hope we can include it in the next PyPI release.

@kernc kernc closed this in #8 Jan 24, 2019

kernc added a commit that referenced this issue Jan 24, 2019

ENH: Add `__main__.py` so that users can do `python -m pdoc` (#8)
#4

* [Issue #4] Add __main__.py such that users can do python -m pdoc

* Only import pdoc.cli.main in __main__.py
@kernc

This comment has been minimized.

Copy link
Contributor

commented Jan 24, 2019

Thanks! It should be released as pdoc3 0.5.2 within a few days. 👍

Updating pip3 didn't seem to resolve the issue for me. Not sure why.

Should you later eventually figure out what was it in your environment, blocking the creation/discovery of executables, I'll appreciate a notice about it.

@kernc kernc added this to the 0.5.2 milestone Jan 24, 2019

@kernc kernc added the help wanted label Jan 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.