In python 2.7.9 I was trying to install bottleneck without sudo access and use its one of the functions argpartsort. But this is what happens:
import bottleneck as bn
bn.argpartsort
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'argpartsort'
I tried various methods:
pip install --user bottleneck
Requirement already satisfied (use --upgrade to upgrade): bottleneck in $HOME/.local/lib/python2.7/site-packages/Bottleneck-1.3.0.dev0-py2.7-linux-x86_64.egg
Requirement already satisfied (use --upgrade to upgrade): numpy in $HOME/.local/lib/python2.7/site-packages (from bottleneck)
Cleaning up...
I tried building from source:
python setup.py install --user
Installed $HOME/.local/lib/python2.7/site-packages/Bottleneck-1.3.0.dev0-py2.7-linux-x86_64.egg
Processing dependencies for Bottleneck==1.3.0.dev0
Searching for numpy==1.12.0
Best match: numpy 1.12.0
Adding numpy 1.12.0 to easy-install.pth file
Using $HOME/.local/lib/python2.7/site-packages
Finished processing dependencies for Bottleneck==1.3.0.dev0
I then tried:
pip install --install-option="--prefix=$HOME/.local" bottleneck
Requirement already satisfied (use --upgrade to upgrade): bottleneck in $HOME/.local/lib/python2.7/site-packages/Bottleneck-1.3.0.dev0-py2.7-linux-x86_64.egg
Requirement already satisfied (use --upgrade to upgrade): numpy in $HOME/.local/lib/python2.7/site-packages (from bottleneck)
Cleaning up...
I tried to export environment variable:
export PYTHONPATH="$HOME/.local/lib/python2.7/site-packages"
but without any luck.
How can I use:
>>> import bottleneck as bn
>>> bn.argpartsort
and get around this error:
AttributeError: 'module' object has no attribute 'argpartsort'
without sudo permissions
I am on:
Distributor ID: Debian
Description: Debian GNU/Linux 8.6 (jessie)
Release: 8.6
Codename: jessie
I appreciate your help, however minimal.
Regards