0

Using setuptools I am able to get python to install in the /opt/ directory but I would also like to specify a single file to be installed in the /usr/bin directory.

Example tree:

setup.py
src/
    file1.py
    file2.py
    main.py

Currently I am using the following command

python setup.py install --install-lib=/opt/src       

to get the following installed.

opt/src/
    file1.py
    file2.py
    main.py

but I would like it to be installed as below.

/opt/src/
    file1.py
    file2.py

/usr/bin/
    main.py
2
  • 1
    The setuptools data_files option might help. However, this option is usually frowned upon due to inconsistency across tools and the difficulty of configuring this option. Commented Sep 11, 2017 at 15:20
  • To install into bin you can declare main.py to be an item of scripts. Commented Sep 11, 2017 at 19:55

1 Answer 1

1

To install into bin you can declare main.py to be a script:

setup(
    …
    scripts=["main.py"],
    …
)
Sign up to request clarification or add additional context in comments.

Comments

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.