I know I can get Python to ignore PYTHONPATH
if I start it with the -E
flag.
But how do I get a script installed by pip
to have this flag?
I tried both the "scripts" and the "console_scripts" section of the code and pip
strips the -E if I put it on the #! line.
I generally recommend against this sort of trickery. The target system puts paths in place for a reason. If you want to break out of a virtualenv you should simply recommend not installing in a virtualenv in your documentation.
However you can remove the entry from
sys.path
.The easiest way right now seems to be to put write a scripts that restarts Python if the flag is not included:
Then in setup.py, put this:
Don't use entry_points/console_scripts. This should not be used for public modules, just for internal scripts.