在anaconda中安装python包

时间:2015-10-05 05:54:51

标签: python install anaconda

有没有人成功安装taynaud / python-louvain库? 我从website下载了一个文件并通过'pip'命令安装了它(来自Anaconda根目录)

$ pip install /Users/sundong/downloads/taynaud-python-louvain-f56ac904d92c/

好像已成功安装。

Requirement already satisfied (use --upgrade to upgrade): python-louvain==0.4 from file:///Users/sundong/downloads/taynaud-python-louvain-f56ac904d92c in ./lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): networkx in ./lib/python2.7/site-packages (from python-louvain==0.4)
Building wheels for collected packages: python-louvain
Running setup.py bdist_wheel for python-louvain
Stored in directory: /Users/sundong/Library/Caches/pip/wheels/2a/50/5c/740608e77d3b5fb8d19060237f3e7fd6ff8e391ad80e54dcb3
Successfully built python-louvain

但是,当我导入社区模块时,会出现ImportError。 ImportError: No module named community

安装此库的常规步骤是什么?我正在使用Mac OS X,以防万一。

我也在anaconda目录中尝试了以下命令。

$ python /Users/sundong/downloads/taynaud-python-louvain-f56ac904d92c/setup.py install

但结果如下。

running install
running bdist_egg
running egg_info
writing requirements to python_louvain.egg-info/requires.txt
writing python_louvain.egg-info/PKG-INFO
writing top-level names to python_louvain.egg-info/top_level.txt
writing dependency_links to python_louvain.egg-info/dependency_links.txt
writing entry points to python_louvain.egg-info/entry_points.txt
warning: manifest_maker: standard file 'setup.py' not found
error: package directory 'community' does not exist

2 个答案:

答案 0 :(得分:2)

哦问题解决了。 它只是通过抛出一个命令 来自setup.py文件所在的python setup.py install。 我的python env已经设置为Anaconda并且软件包自动安装到anaconda site-package文件夹中,这有点令人惊讶。 也许我的第一种方法太复杂了。

答案 1 :(得分:0)

conda install -c marufr python-igraph

conda install -c vtraag louvain