Pyenv shim is not generated when installing package using setup.py
When I install a package in pyenv environment with ./setup.py install
, the script package is not added to the pyenv shim directory. As a result, the script is not in my PATH and cannot be executed normally.
My package uses setuptools. My package setup.py
specifies the script to be installed.
SCRIPTS = [ 'bin/olio_msg_send_test_messages', ] setup( ... scripts=SCRIPTS, ... )
When I install the package using:
./setup.py build
./setup.py install
The script is then installed into the package directory:
...
Installing olio_msg_send_test_messages script to /home/wayne/.pyenv/versions/2.6.9/bin
...
And the file really is:
$ ls -l /home/wayne/.pyenv/versions/2.6.9/bin/olio_msg_send_test_messages
-rwxrwxr-x 1 wayne wayne 240 Apr 20 09:30 /home/wayne/.pyenv/versions/2.6.9/bin/olio_msg_send_test_messages
However, in pyenv :
$ ls -l ~/.pyenv/shims/olio_msg_send_test_messages
ls: cannot access /home/wayne/.pyenv/shims/olio_msg_send_test_messages: No such file or directory
Therefore the script is not in my PATH and cannot be executed by typing its name.
What do I need to do to create a pyenv shim when I install the package via ./setup.py install
?
Versions:
- pyenv 20141118
- python 2.6.7
source to share
Versions of pyenv before v20141211 do not automatically rephrase (i.e. update shims) when installing a new package. To get pyenv to automatically rephrase, either upgrade to a newer version of pyenv or install the pyenv-pip-refresh plugin .
To redraw manually, use this command for bash:
pyenv rehash && hash -r
or this command for zsh
:
pyenv rehash && rehash
(The rehash instructions from yyuu in the answer to this github question )
source to share