Skip to content

Conversation

@DanLipsitt
Copy link

Problem

On systems where python points to python2 but pip points to pip3, bin/flameprof breaks because it runs python2 but the flameprof library is installed into python2's site-packages.

Fix

Instead of using scripts in setup.py, use the console_scripts entry point (https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html). This will automatically create and install a flameprof script that works with python 2 or 3 (whichever pip is working with).

In order to facilitate this, I created a main function in flameprof.py.

Problem
-------
On systems where `python` points to `python2` but `pip` points to
`pip3`, `bin/flameprof` breaks because it runs python2 but the
flameprof library is installed into python2's `site-packages`.

Fix
---
Instead of using `scripts` in `setup.py`, use the `console_scripts`
entry
point (https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html). This
will automatically create and install a `flameprof` script that works
with python 2 or 3 (whichever pip is working with).

In order to facilitate this, I created a `main` function in `flameprof.py`.
@rossburton
Copy link

Would be great if this could be merged and a new release made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants