CiscoDevNet / yang-explorer

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

Can't login: from ydk.app_maker import YdkAppMaker ImportError: No module named app_maker #71

Open kuhlskev opened 7 years ago

kuhlskev commented 7 years ago

here's what I get from the console

[22/Jun/2017 12:35:53]"GET /explorer/session HTTP/1.1" 500 137785 [22/Jun/2017 12:36:15] ERROR [django.request] Internal Server Error: /explorer/login Traceback (most recent call last): File "/Users/kekuhls/anaconda/lib/python2.7/site-packages/django/core/handlers/base.py", line 108, in get_response response = middleware_method(request) File "/Users/kekuhls/anaconda/lib/python2.7/site-packages/django/middleware/common.py", line 74, in process_request if (not urlresolvers.is_valid_path(request.path_info, urlconf) and File "/Users/kekuhls/anaconda/lib/python2.7/site-packages/django/core/urlresolvers.py", line 647, in is_valid_path resolve(path, urlconf) File "/Users/kekuhls/anaconda/lib/python2.7/site-packages/django/core/urlresolvers.py", line 522, in resolve return get_resolver(urlconf).resolve(path) File "/Users/kekuhls/anaconda/lib/python2.7/site-packages/django/core/urlresolvers.py", line 366, in resolve for pattern in self.url_patterns: File "/Users/kekuhls/anaconda/lib/python2.7/site-packages/django/core/urlresolvers.py", line 402, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/Users/kekuhls/anaconda/lib/python2.7/site-packages/django/core/urlresolvers.py", line 396, in urlconf_module self._urlconf_module = import_module(self.urlconf_name) File "/Users/kekuhls/anaconda/lib/python2.7/importlib/init.py", line 37, in import_module import(name) File "/Users/kekuhls/projects/yang-explorer/server/server/urls.py", line 28, in ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static('/download/', document_root=os.path.join(settings.BASE_DIR,'data')) File "/Users/kekuhls/anaconda/lib/python2.7/site-packages/django/conf/urls/init.py", line 33, in include urlconf_module = import_module(urlconf_module) File "/Users/kekuhls/anaconda/lib/python2.7/importlib/init.py", line 37, in import_module import(name) File "/Users/kekuhls/projects/yang-explorer/server/explorer/urls.py", line 20, in from explorer import views, profile_view File "/Users/kekuhls/projects/yang-explorer/server/explorer/views.py", line 30, in from explorer.utils.adapter import Adapter File "/Users/kekuhls/projects/yang-explorer/server/explorer/utils/adapter.py", line 30, in from ydk.app_maker import YdkAppMaker ImportError: No module named app_maker

kuhlskev commented 7 years ago

If I comment out the YDK import and ydk generator function from the adapter it appears to work fine. I can't find where to install appmaker. It would be nice to have but not critical to my use today.

jmcgill298 commented 6 years ago

I have the same issue. I also don't see where app_maker has ever been associated with the ydk library. Where is this supposed to be loading from?

ghost commented 6 years ago

Have you run setup.sh? It should have installed ydk library. See here

jmcgill298 commented 6 years ago

yes

ghost commented 6 years ago

If you have run this script, looks like it creates a virtualenv in a directory named “v” where it installs everything. Can you try activating this virtualenv using a command something like the below?

source v/bin/activate

Then, you can check if ydk is installed using the below command:

pip list|grep ydk

After the above, can you try logging in again?

jmcgill298 commented 6 years ago

I will have to completely reinstall it, at this point I have already cleaned it up

jmcgill298 commented 6 years ago

reinstalled and the same issue.

(netconf) >ls v/lib/python2.7/site-packages/ | grep ydk
ydk
ydk-0.6.3.dist-info
ydk_models_ietf-0.1.4.dist-info
ydk_models_ietf-0.1.4-py3.5-nspkg.pth
ydk_models_openconfig-0.1.4.dist-info
ydk_models_openconfig-0.1.4-py3.5-nspkg.pth
ydk_.so

Again, I don't see where app_maker exists; where should this be importing from?

ghost commented 6 years ago

Looks like you have ydk 0.6.3 (latest version) installed somehow.

But, setup.sh installs older 0.5.4 version which has app_maker module.

Can you please uninstall and reinstall as below:

pip uninstall ydk ydk-models-cisco-ios-xr ydk-models-ietf ydk-models-openconfig

git clone https://github.com/CiscoDevNet/ydk-py.git -b yam; \
cd ydk-py; \
cd core; \
python setup.py sdist; \
pip install dist/ydk*.gz; \
cd ../ietf; \
python setup.py sdist; \
pip install dist/ydk*.gz; \
cd ../openconfig; \
python setup.py sdist; \
pip install dist/ydk*.gz; \
cd ../cisco-ios-xr; \
python setup.py sdist; \
pip install dist/ydk*.gz; \
jmcgill298 commented 6 years ago

If you look at the path in my output you will notice those are the ydk packages in the v virtualenv created by the bash script. The bash script does not install 0.5.4, but actually a branch of version 0.5.5 (which does work). The problem is that installing the models actually causes ydk to upgraded to the latest version. I re-installed from ydk-py/core and it did allow the login.

nk9b commented 6 years ago

I'm seeing the same issue. As long as you don't upgrade the models, yang-explorer will start. However, if you subsequently run setup.sh, the latest ydk is installed because of the most recent model dependencies. This is a problem since you'll want to use the latest models for your IOS platform. If you make the mistake of running ./setup.sh, the ydk build wheel fails and you'll receive the app_maker error as noted by the OP. You have to run the script/steps above from abhikeshav to downgrade ydk and the models. Lather, rinse, repeat. :-)

Is there a fix for the dependency of ydk < v0.7.1?