使用命令pip install ‘networkx==2.2’ 下载networkx失败 报错

root@nettraffic-vm:~# pip install 'networkx==2.2'
Downloading/unpacking networkx==2.2
  http://pypi.douban.com/simple/networkx/2.2 uses an insecure transport scheme (http). Consider using https if pypi.douban.com has it available
  http://pypi.douban.com/simple/networkx/ uses an insecure transport scheme (http). Consider using https if pypi.douban.com has it available
  Downloading networkx-2.2.zip (1.7MB): 1.7MB downloaded
  Running setup.py (path:/tmp/pip_build_root/networkx/setup.py) egg_info for package networkx
    
    warning: no files found matching '*.html' under directory 'doc'
    warning: no files found matching '*.css' under directory 'doc'
    warning: no previously-included files matching '*~' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '.svn' found anywhere in distribution
    no previously-included directories found matching 'doc/build'
    no previously-included directories found matching 'doc/auto_examples'
    no previously-included directories found matching 'doc/modules'
    no previously-included directories found matching 'doc/reference/generated'
    no previously-included directories found matching 'doc/reference/algorithms/generated'
    no previously-included directories found matching 'doc/reference/classes/generated'
    no previously-included directories found matching 'doc/reference/readwrite/generated'
Downloading/unpacking decorator>=4.3.0 (from networkx==2.2)
  http://pypi.douban.com/simple/decorator/ uses an insecure transport scheme (http). Consider using https if pypi.douban.com has it available
  Downloading decorator-5.0.9.tar.gz
  Running setup.py (path:/tmp/pip_build_root/decorator/setup.py) egg_info for package decorator
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/decorator/setup.py", line 4, in <module>
        exec(open('src/decorator.py').read(), dic)  # extract the __version__
      File "<string>", line 162
        print('Error in generated code:', file=sys.stderr)
                                              ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/decorator/setup.py", line 4, in <module>

    exec(open('src/decorator.py').read(), dic)  # extract the __version__

  File "<string>", line 162

    print('Error in generated code:', file=sys.stderr)

                                          ^

SyntaxError: invalid syntax

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/decorator
Storing debug log for failure in /root/.pip/pip.log

环境为python2.7.6,ubantu14.04

能解决的我可以加微信发红包感谢!

这个问题我也遇到了。你会发现真正报错的点是在decorator-5.0.9上。所以只需要提前安装decorator-4.3.0,然后在安装networkx2.2就可以通过了。

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple networkx

pip3 install --upgrade pip

然后再

pip install -i https://mirrors.aliyun.com/pypi/simple/ networkx==2.2

 

这是sdn的实验环境配置

 

您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632

刚弄好了,,, sudo pip install 'networkx==2.2'