CiscoDevNet / yang-explorer

An open-source Yang Browser and RPC Builder Application
Apache License 2.0
438 stars 177 forks source link

ImportError: cannot import name _remove_dead_weakref #83

Closed jean-christophe-manciot closed 6 years ago

jean-christophe-manciot commented 6 years ago
yang-explorer# stable_branch=master
yang-explorer# git checkout $stable_branch
Already on 'master'
Your branch is up to date with 'origin/master'.
yang-explorer# git stash
No local changes to save
yang-explorer# git pull -v --progress --no-edit origin $stable_branch
From https://github.com/CiscoDevNet/yang-explorer
 * branch            master     -> FETCH_HEAD
 = [up to date]      master     -> origin/master
Already up to date.
yang-explorer# git stash apply
No stash entries found.
yang-explorer# bash setup.sh
Installing yang-explorer ..
Checking environment ..
Creating / Activating virtualenv ..
Installing dependencies ..
Traceback (most recent call last):
  File "/home/actionmystique/Ansible/yang-explorer/v/bin/pip", line 7, in <module>
    from pip import main
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pip/__init__.py", line 5, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Traceback (most recent call last):
  File "/home/actionmystique/Ansible/yang-explorer/v/bin/pip", line 7, in <module>
    from pip import main
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pip/__init__.py", line 5, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
fatal: destination path 'ydk-py' already exists and is not an empty directory.
Traceback (most recent call last):
  File "setup.py", line 24, in <module>
    from setuptools.command.build_ext import build_ext
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/setuptools/__init__.py", line 12, in <module>
    import setuptools.version
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/setuptools/version.py", line 1, in <module>
    import pkg_resources
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
    import packaging.requirements
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/packaging/requirements.py", line 9, in <module>
    from pyparsing import stringStart, stringEnd, originalTextFor, ParseException
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pyparsing.py", line 68, in <module>
    from weakref import ref as wkref
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Traceback (most recent call last):
  File "/home/actionmystique/Ansible/yang-explorer/v/bin/pip", line 7, in <module>
    from pip import main
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pip/__init__.py", line 5, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Traceback (most recent call last):
  File "setup.py", line 23, in <module>
    from setuptools import setup, find_packages
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/setuptools/__init__.py", line 12, in <module>
    import setuptools.version
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/setuptools/version.py", line 1, in <module>
    import pkg_resources
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
    import packaging.requirements
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/packaging/requirements.py", line 9, in <module>
    from pyparsing import stringStart, stringEnd, originalTextFor, ParseException
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pyparsing.py", line 68, in <module>
    from weakref import ref as wkref
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Traceback (most recent call last):
  File "/home/actionmystique/Ansible/yang-explorer/v/bin/pip", line 7, in <module>
    from pip import main
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pip/__init__.py", line 5, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Traceback (most recent call last):
  File "setup.py", line 23, in <module>
    from setuptools import setup, find_packages
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/setuptools/__init__.py", line 12, in <module>
    import setuptools.version
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/setuptools/version.py", line 1, in <module>
    import pkg_resources
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
    import packaging.requirements
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/packaging/requirements.py", line 9, in <module>
    from pyparsing import stringStart, stringEnd, originalTextFor, ParseException
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pyparsing.py", line 68, in <module>
    from weakref import ref as wkref
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Traceback (most recent call last):
  File "/home/actionmystique/Ansible/yang-explorer/v/bin/pip", line 7, in <module>
    from pip import main
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pip/__init__.py", line 5, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Traceback (most recent call last):
  File "setup.py", line 23, in <module>
    from setuptools import setup, find_packages
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/setuptools/__init__.py", line 12, in <module>
    import setuptools.version
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/setuptools/version.py", line 1, in <module>
    import pkg_resources
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
    import packaging.requirements
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/packaging/requirements.py", line 9, in <module>
    from pyparsing import stringStart, stringEnd, originalTextFor, ParseException
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pyparsing.py", line 68, in <module>
    from weakref import ref as wkref
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Traceback (most recent call last):
  File "/home/actionmystique/Ansible/yang-explorer/v/bin/pip", line 7, in <module>
    from pip import main
  File "/home/actionmystique/Ansible/yang-explorer/v/local/lib/python2.7/site-packages/pip/__init__.py", line 5, in <module>
    import logging
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Installing dependencies .. done
Setting up initial database ..
Database already exist .. skipping
Setup completed.. 

Use start.sh to start yang-explorer server
jean-christophe-manciot commented 6 years ago

@pgohite @rustogi Some comments about that issue?

robertcsapo commented 6 years ago

If you google “cannot import name _remove_dead_weakref” it seems related to virtualenv.

jean-christophe-manciot commented 6 years ago

I completely reinstalled yang-explorer as a workaround. FYI, the ydk-py folder must be purged before running bash setup.sh, otherwise the latter fails.