cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2502
Views
8
Helpful
8
Replies

Installing and Running YANG Suite on a Mac - Tips

Alexander Stevenson
Cisco Employee
Cisco Employee

 

What I wish someone would have told me about installing YANG Suite 

This was on a MacBook Pro, done today April 25, 2022

 

  1. Install Docker Desktop on your PC, start it and keep it running when you want to use YANG Suite
  2. Figure out where you want to install YANG Suite and run ‘git clone https://github.com/CiscoDevNet/yangsuite/'
  3. Enter the Yang Suite folder --> 'cd yangsuite'
  4. I like to start a virtual environment here ‘python3 -m vent vent’. And then ‘source venv/bin/activate’ it’s a little different for Python2 and/or on Windows
  5. You’ll need to install docker-compose if you want to use that to start YANG Suite. I prefer starting YANG Suite with this command instead --> from the yangsuite/docker folder: ‘./start_yang_suite.sh’
  6. Enter the GUI  --> Go to http://localhost    I had to use Firefox as it was blocked on Chrome
  7. There is a free, Always-On sandbox to try out YANG Suite with: IOS XE on CSR Recommended Code AlwaysOn  
  8. This lab is helpful for beginners: Introduction to YANG Suite 

 

Enjoy!

8 Replies 8

hypnotoad
Level 3
Level 3

I'm trying to get YangSuite installed on my Mac.  I followed the above.  I get this error:

 

#13 15.67   Downloading https://files.pythonhosted.org/packages/a1/0d/a1b490503545b3b4600b965eae5d44cc2b6ce27cfb44f4debc563dbb56d3/textfsm-0.4.1.tar.gz
#13 15.91 Collecting cryptography>3.3.1 (from yangsuite-devices; extra == "core"->yangsuite[core])
#13 16.42   Downloading https://files.pythonhosted.org/packages/89/d9/5fcd312d5cce0b4d7ee8b551a0ea99e4ea9db0fdbf6dd455a19042e3370b/cryptography-37.0.4.tar.gz (585kB)
#13 16.76     Complete output from command python setup.py egg_info:
#13 16.76     Traceback (most recent call last):
#13 16.76       File "<string>", line 1, in <module>
#13 16.76       File "/tmp/pip-build-5eb_0lt0/cryptography/setup.py", line 14, in <module>
#13 16.76         from setuptools_rust import RustExtension
#13 16.76     ModuleNotFoundError: No module named 'setuptools_rust'
#13 16.76     
#13 16.76             =============================DEBUG ASSISTANCE==========================
#13 16.76             If you are seeing an error here please try the following to
#13 16.76             successfully install cryptography:
#13 16.76     
#13 16.76             Upgrade to the latest pip and try again. This will fix errors for most
#13 16.76             users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
#13 16.76             =============================DEBUG ASSISTANCE==========================
#13 16.76     
#13 16.76     
#13 16.76     ----------------------------------------
#13 17.11 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5eb_0lt0/cryptography/
------
executor failed running [/bin/sh -c pip3 install --upgrade --no-cache yangsuite[core]]: exit code: 1
ERROR: Service 'yangsuite' failed to build : Build failed

I've tried upgrading pip and setuptools.

 

Package           Version

----------------- -------

pip               22.1.2

semantic-version  2.10.0

setuptools        63.1.0

setuptools-rust   1.4.1

typing_extensions 4.3.0

 

How do I fix?

 

Thanks,

Patrick

It looks like you need to install cryptography and updating to the latest version of pip might help too.

Hi @Alexander Stevenson 

I deal with this Yang Suite about a month ago. By the end, I've created a new python 8 environment (3.8.19) and installed all the dependencies. Didn't see any relevant issue at that time.

In attach, you have the pip freeze, in case you like to just install the pip packages in the exact same version (pip install -r yangsuite.txt).

@bigevilbeard ,
I believe python 3.8 is the way to go now. The release 3.8 utilized in the mac install example at Yang Suite git repo.
https://github.com/CiscoDevNet/yangsuite

Hope it helps....

 

 

@Daniel Kratz thats interesting then, i am sure this was an issue with backports and that python version, thanks for clarifying this! Maybe if @khanhvn does tries installing it explicitly, it could fix the issue?

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

khanhvn
Cisco Employee
Cisco Employee

I installed Yang Suite using pip according to the instructions, but got this error whrn running yangsuite.  What did I miss?

(yangsuitevenv) KHANHVN-M-81M4:~ khanhvn$ yangsuite

Traceback (most recent call last):

  File "/Users/khanhvn/yangsuitevenv/bin/yangsuite", line 5, in <module>

    from yangsuite.application import main

  File "/Users/khanhvn/yangsuitevenv/lib/python3.8/site-packages/yangsuite/application.py", line 18, in <module>

    from pkg_resources import iter_entry_points

  File "/Users/khanhvn/yangsuitevenv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 93, in <module>

    from jaraco.text import (

  File "/Users/khanhvn/yangsuitevenv/lib/python3.8/site-packages/setuptools/_vendor/jaraco/text/__init__.py", line 12, in <module>

    from jaraco.context import ExceptionTrap

  File "/Users/khanhvn/yangsuitevenv/lib/python3.8/site-packages/setuptools/_vendor/jaraco/context.py", line 17, in <module>

    from backports import tarfile

ImportError: cannot import name 'tarfile' from 'backports' (/Users/khanhvn/yangsuitevenv/lib/python3.8/site-packages/backports/__init__.py)

(yangsuitevenv) KHANHVN-M-81M4:~ khanhvn$ yangsuite -h

Traceback (most recent call last):

  File "/Users/khanhvn/yangsuitevenv/bin/yangsuite", line 5, in <module>

    from yangsuite.application import main

  File "/Users/khanhvn/yangsuitevenv/lib/python3.8/site-packages/yangsuite/application.py", line 18, in <module>

    from pkg_resources import iter_entry_points

  File "/Users/khanhvn/yangsuitevenv/lib/python3.8/site-packages/pkg_resources/__init__.py", line 93, in <module>

    from jaraco.text import (

  File "/Users/khanhvn/yangsuitevenv/lib/python3.8/site-packages/setuptools/_vendor/jaraco/text/__init__.py", line 12, in <module>

    from jaraco.context import ExceptionTrap

  File "/Users/khanhvn/yangsuitevenv/lib/python3.8/site-packages/setuptools/_vendor/jaraco/context.py", line 17, in <module>

    from backports import tarfile

ImportError: cannot import name 'tarfile' from 'backports' (/Users/khanhvn/yangsuitevenv/lib/python3.8/site-packages/backports/__init__.py)

@khanhvn your  error message indicates that the tarfile module cannot be imported from the backports package, guessing shis is likely because the backports.tarfile module is not compatible with Python 3.8, which is the version you are running. Create an venv and run this with Python 3.7.

Hope this helps.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

khanhvn
Cisco Employee
Cisco Employee

@bigevilbeard That helps.  Python 3.7 works.  Thanks a lot.

@khanhvn Lucky guess! Can you mark as solution accepted so this helps others in case they see the same issue. Thanks

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io