Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python entry point commandline script not found when installing with --user flag

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?

like image 640
Benjamin Maier Avatar asked Dec 24 '22 10:12

Benjamin Maier


1 Answers

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

$ source ~/.bash_profile

solved the issue.

like image 165
Benjamin Maier Avatar answered Dec 27 '22 07:12

Benjamin Maier