4

I recently wrote a package which comes with a command line tool. The setup.py looks something like this

from setuptools import setup

setup(...
      entry_points = {
            'console_scripts': [
                    'cmdname = modulename.binary:main',
                ],
          },
      ...)

everything is fine when I install it without the --user flag via

$ sudo python setup.py install
$ cmdname
Yes, I'm here! Give me a command!

however, installing it without root access gives

$ python setup.py install --user
$ cmdname
-bash: cmdname: command not found

I guess there should be a directory where user scripts are linked to that should be exported to the PATH? How can I achieve that setuptools links to the entry point anyway? Or is that not possible?

1 Answer 1

12

The binary was installed to ~/.local/bin/. Hence, adding export PATH=~/.local/bin:$PATH to ~/.bash_profile and

$ source ~/.bash_profile

solved the issue.

Sign up to request clarification or add additional context in comments.

1 Comment

Man! No one could give me a proper answer! After an hour of searching you saved me from my misery! Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.