0

誰かがPython用のapglグラフライブラリを正常にインストールしましたか?http://packages.python.org/apgl/同じ単純さでapglと同じことを行うPythonの他の代替グラフライブラリはありますか?

現在、Ubuntu 12.04ディストリビューションを使用しており、依存ライブラリをここにインストールしました。

sudo apt-get install pip
sudo pip install numpy
sudo apt-get install libatlas-base-dev gfortran g++
sudo pip install scipy
sudo pip install matplotlib
sudo pip install agpl

それは正常にインストールされました、そして私がしたとき:

>>> import apgl
>>> apgl.test()

エラーが発生しました:

>>> apgl.test()
Running tests from /usr/local/lib/python2.7/dist-packages/apgl
..............s....................................................E...........E.................................................ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.....................................................................E.........E.........................................sssssssss...sssssss..sssssssssssssssssssssssssssss.................................s....s..ss..........
======================================================================
ERROR: testLoad (graph.test.SparseGraphTest.SparseGraphTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/apgl/graph/test/MatrixGraphTest.py", line 1619, in testLoad
    graph.save(tempFile)
  File "/usr/local/lib/python2.7/dist-packages/apgl/graph/AbstractMatrixGraph.py", line 558, in save
    import zipfile
  File "/usr/lib/python2.7/zipfile.py", line 464, in <module>
    class ZipExtFile(io.BufferedIOBase):
AttributeError: 'module' object has no attribute 'BufferedIOBase'

======================================================================
ERROR: testPickle (graph.test.SparseGraphTest.SparseGraphTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/apgl/graph/test/MatrixGraphTest.py", line 2309, in testPickle
    output = pickle.dumps(graph)
  File "/usr/lib/python2.7/pickle.py", line 1374, in dumps
    Pickler(file, protocol).dump(obj)
  File "/usr/lib/python2.7/pickle.py", line 224, in dump
    self.save(obj)
  File "/usr/lib/python2.7/pickle.py", line 306, in save
    rv = reduce(self.proto)
  File "/usr/lib/python2.7/copy_reg.py", line 84, in _reduce_ex
    dict = getstate()
  File "/usr/local/lib/python2.7/dist-packages/apgl/graph/AbstractMatrixGraph.py", line 1287, in __getstate__
    self.save(tempFile.name)
  File "/usr/local/lib/python2.7/dist-packages/apgl/graph/AbstractMatrixGraph.py", line 558, in save
    import zipfile
  File "/usr/lib/python2.7/zipfile.py", line 464, in <module>
    class ZipExtFile(io.BufferedIOBase):
AttributeError: 'module' object has no attribute 'BufferedIOBase'

======================================================================
ERROR: testLoad (graph.test.DenseGraphTest.DenseGraphTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/apgl/graph/test/MatrixGraphTest.py", line 1619, in testLoad
    graph.save(tempFile)
  File "/usr/local/lib/python2.7/dist-packages/apgl/graph/AbstractMatrixGraph.py", line 558, in save
    import zipfile
  File "/usr/lib/python2.7/zipfile.py", line 464, in <module>
    class ZipExtFile(io.BufferedIOBase):
AttributeError: 'module' object has no attribute 'BufferedIOBase'

======================================================================
ERROR: testPickle (graph.test.DenseGraphTest.DenseGraphTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/apgl/graph/test/MatrixGraphTest.py", line 2309, in testPickle
    output = pickle.dumps(graph)
  File "/usr/lib/python2.7/pickle.py", line 1374, in dumps
    Pickler(file, protocol).dump(obj)
  File "/usr/lib/python2.7/pickle.py", line 224, in dump
    self.save(obj)
  File "/usr/lib/python2.7/pickle.py", line 306, in save
    rv = reduce(self.proto)
  File "/usr/lib/python2.7/copy_reg.py", line 84, in _reduce_ex
    dict = getstate()
  File "/usr/local/lib/python2.7/dist-packages/apgl/graph/AbstractMatrixGraph.py", line 1287, in __getstate__
    self.save(tempFile.name)
  File "/usr/local/lib/python2.7/dist-packages/apgl/graph/AbstractMatrixGraph.py", line 558, in save
    import zipfile
  File "/usr/lib/python2.7/zipfile.py", line 464, in <module>
    class ZipExtFile(io.BufferedIOBase):
AttributeError: 'module' object has no attribute 'BufferedIOBase'

----------------------------------------------------------------------
Ran 423 tests in 46.433s

FAILED (errors=4, skipped=120)
4

1 に答える 1

0

ある種のUbuntuの問題があるようです。

   File "/usr/lib/python2.7/zipfile.py", line 464, in <module>
   class ZipExtFile(io.BufferedIOBase):
AttributeError: 'module' object has no attribute 'BufferedIOBase'

Pythonのインストールに問題があることを示します。

自分でインストールしましたか?

さらに...pipは素晴らしいですが、パッケージマネージャーを使用することをお勧めします。本当に新しいバージョンまたはパッケージ化されていないバージョンをインストールする必要がある場合にのみ、 pipを使用する必要があります。したがって、pip doでインストールする代わりに、

apt-get install python-scipy python-numpy python-matplotlib

そして、pipを使用してapglをインストールします。

本日(2012年9月13日)にパッケージが更新されたDebian Wheezyでインストールapglを正常にテストしましたが、テスト結果は良好です。

 In [22]: apgl.test()
Running tests from /usr/local/lib/python2.7/dist-packages/apgl
......./usr/lib/python2.7/dist-packages/scipy/sparse/compressed.py:486: SparseEfficiencyWarning: changing the sparsity structure of a csr_matrix is expensive. lil_matrix is more efficient.
  SparseEfficiencyWarning)
....s...........................................................................................ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss...................................................................................................................................................sssssssss...ssssssssssssssssssssssssssssssssssss......................s....s.........................ss
----------------------------------------------------------------------
Ran 423 tests in 25.454s

OK (skipped=120)
于 2012-09-13T05:52:01.230 に答える