2017-01-21 16 views
1

python 2.7.9でsudoアクセスなしでbottleneckをインストールしようとしましたが、そのうちの1つを使用していますargpartsort。しかし、これは何が起こるかです:AttributeError: 'module'オブジェクトに 'argpartsort'属性がありません

import bottleneck as bn 
bn.argpartsort 
Traceback (most recent call last): 
File "<stdin>", line 1, in <module> 
AttributeError: 'module' object has no attribute 'argpartsort' 

私はさまざまな方法を試してみました:

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... 

私はソースからビルドしようとした:

 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 

私は、試してみました:

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... 

を私は環境変数をエクスポートしようとしました:

export PYTHONPATH="$HOME/.local/lib/python2.7/site-packages" 

しかし、運がない。私はあなたに感謝

Distributor ID: Debian 
Description: Debian GNU/Linux 8.6 (jessie) 
Release: 8.6 
Codename: jessie 

>>> import bottleneck as bn 
>>> bn.argpartsort 

と、このエラーを回避:

AttributeError: 'module' object has no attribute 'argpartsort' 

にsudo権限のない

私は日午前どのように使用することができます

しかし、最小限に抑えてください。

ありがとうございます

答えて

0

インストールに間違いはありません。

チェックBottleneck 1.2.0 Release Notes

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

+0

はどうもありがとうございました。 – Learner

関連する問題