1

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

1 Answer 1

1

There is likely nothing wrong with your install.

Check the Bottleneck 1.2.0 Release Notes:

Functions partsort and argpartsort have been renamed to partition and argpartition to match NumPy.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.