[Networkit] pip install fails with "cannot import name DEVNULL"

Ian ian.wood at anu.edu.au
Fri Feb 20 03:15:40 CET 2015


OK, it's proving difficult to install with pip (as opposed to pip3, which I've not tried yet - will it be available to python 2.7 if I install with pip3??)

Anyway, I cloned the repo and fixed the DEVNULL problem below, installed gcc and g++ 4.8 (from the ubuntu-toolchain-r/test ppa for Ubuntu), installed SCons (which I had to install with pip --egg … due to a bug which is fixed but not in the current version on pip), but now when I install from my networkit clone, it freezes. htop shows no activity in the pip process.. I'll leave it trying over lunch, but I'm not hopefull.


On 20/02/2015, at 12:24 PM, Ian <ian.wood at anu.edu.au> wrote:

> When I try to install networkit with pip, i get 
> 
>     Traceback (most recent call last):
>       File "<string>", line 20, in <module>
>       File "/tmp/pip-build-18HYDO/networkit/setup.py", line 2, in <module>
>         from setup_util import *
>       File "setup_util.py", line 3, in <module>
>         from subprocess import DEVNULL
>     ImportError: cannot import name DEVNULL
>     Complete output from command python setup.py egg_info:
>     Traceback (most recent call last):
>     
>       File "<string>", line 20, in <module>
>     
>       File "/tmp/pip-build-18HYDO/networkit/setup.py", line 2, in <module>
>     
>         from setup_util import *
>     
>       File "setup_util.py", line 3, in <module>
>     
>         from subprocess import DEVNULL
>     
>     ImportError: cannot import name DEVNULL
> 
> I had a look at the docs for the subprocess module, and it seems subprocess.DEVNULL is new in python 3, and doesn't exist in python 2.7
> 
> Instead, we could use os.devnull as per this SO answer. I'm a bit busy to setup a pull request on algohub, but adding "with open(os.devnull,'w') as DEVNULL:" before line 90 in setup_util.py and removing line 3 would do it, or a try statement around line 3 and a mechanism to close DEVNULL when alls done…
> 
> Cheers
> Ian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ira.uni-karlsruhe.de/mailman/private/networkit/attachments/20150220/01f87421/attachment.html>


More information about the NetworKit mailing list