0

I have followed the pip tutorial at http://peterdowns.com/posts/first-time-with-pypi.html. But when i run pip install mypackage it installs the source code into site-packages under my Python folder.

How can i make it install into path, so i can run $ mypackage?

That is, I would like to be able to use my python package as a regular binary application. Right now i can cd into the folder under site-packages and run chmod +x mypackage.py, then ./mypackage.py to run it. But i would like to be able to run it from any directory.

1 Answer 1

1

Ideally you do it by defining console scripts in your package configuration. Then you install the package with pip just as you have done before (or better in a virtualenv), but during the installation a link will be created in the bin directory to the console script that you have configured. See e.g. http://calvinx.com/2012/09/09/python-packaging-define-an-entry-point-for-console-commands/

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

1 Comment

No link in the meaning of file system link is being created. There's Python wrapper script being created which imports entry point and runs it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.