I'm trying to create a package of my own. The package is very simple, it has one python module and one bash script. I wan both of them to be installed under /usr/local/bin so that they can be directly executed.
Here's my setup.py file:
from setuptools import setup
setup(
    name='deploy',
    .
    .
    .
    install_requires=['pyyaml', 'cot', 'jsonschema'],
    entry_points={
        'console_scripts': [
            'cloud_config = cloud_config:main',
        ],
    },
    scripts=['deploy.sh'],
)
Here's excerpt from output of pip install ...:
running install_scripts
    copying build/scripts-2.7/deploy.sh -> /usr/local/lib/python2.7.10/bin
    changing mode of /usr/local/lib/python2.7.10/bin/deploy.sh to 755
    Installing cloud_config script to /usr/local/lib/python2.7.10/bin
With this, I'm not able to invoke either the python or the bash script directly.
Any ideas?
Edit: I'm running the pip on Ubuntu 16.04.1 machine. Just tried to install the same package on a Ubuntu 14.04 machine and behavior is as expected. cloud_config.py and deploy.sh both get installed to /usr/local/bin and I can invoke both from anywhere on the system.
Two options I can think of, first,check that pip is pointing in the right place. So try:
which python
mine says:
/usr/bin/python
yours will be different, change the path accordingly to then make sure the PATH is properly set, so:
export PATH=/usr/bin/python:${PATH}
Reinstall pip and try again. Failing that, a workaround might be to not use pip in this instance and try:
python setup.py install
which will use your default python path (not pip) and should install to:
/usr/local/bin 
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With