cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
628
Views
0
Helpful
6
Replies
Beginner

Trouble installing PyATS + Genie on Ubuntu

Hi

I have installed PyATS on an Ubuntu 16.04 LTS VM... see below

kaj0103@ubuntu:~/NPA$ pyats version
You are currently running pyATS version: 19.0
Python: 3.5.2 [64bit]

Package Version
-------------------- -------
pyats 19.0
pyats.aereport 19.0
pyats.aetest 19.0.1
pyats.async 19.0
pyats.connections 19.0
pyats.datastructures 19.0
pyats.easypy 19.0.1
pyats.examples 19.0
pyats.kleenex 19.0.1
pyats.log 19.0.1
pyats.results 19.0
pyats.tcl 19.0
pyats.templates 19.0
pyats.topology 19.0
pyats.utils 19.0.1

 

I then installed genie using the following command, "pip install genie --user"

 

and every time I enter the genie command, regardless of what I try to do I get this output:

kaj0103@ubuntu:~/NPA$ genie
Traceback (most recent call last):
File "src/genie/utils/profile.py", line 45, in genie.utils.profile
profile.py and cProfile.py modules.
File "<frozen importlib._bootstrap_external>", line 388, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 809, in load_module
File "<frozen importlib._bootstrap_external>", line 668, in load_module
File "<frozen importlib._bootstrap>", line 268, in _load_module_shim
File "<frozen importlib._bootstrap>", line 693, in _load
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 661, in exec_module
File "<frozen importlib._bootstrap_external>", line 766, in get_code
File "<frozen importlib._bootstrap_external>", line 818, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/usr/genie_yamls/__init__.py'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/kaj0103/.local/bin/genie", line 6, in <module>
from genie.cli.__main__ import main
File "src/genie/cli/__main__.py", line 9, in init genie.cli.__main__
File "src/genie/cli/commands/diff.py", line 20, in init genie.cli.commands.diff
File "/home/kaj0103/.local/lib/python3.5/site-packages/genie/harness/__init__.py", line 34, in <module>
from .main import main
File "src/genie/harness/main.py", line 18, in init genie.harness.main
File "src/genie/harness/discovery.py", line 23, in init genie.harness.discovery
File "/home/kaj0103/.local/lib/python3.5/site-packages/genie/harness/commons.py", line 4, in <module>
from . import _commons_internal
File "src/genie/harness/_commons_internal.py", line 36, in init genie.harness._commons_internal
File "src/genie/utils/profile.py", line 47, in init genie.utils.profile
"""
ImportError: Cannot import genie_yamls module.

 

Can anyone offer some help or guidance on this please? I feel as though I have not done anything out of the ordinary to do this installation, but, on the other hand I am no unix admin so am not really equipped to troubleshoot it that well. Any guidance or advice would be appreciated. P.s. I have tried uninstalling and reinstalling genie, same outcome.

Many thanks

Everyone's tags (4)
6 REPLIES 6
Beginner

Re: Trouble installing PyATS + Genie on Ubuntu

To update, I've since updated to Ubuntu 18.04. pip was not installed so I have installed that, pyats was not installed so I have installed that..... genie was not installed so I have installed that... the error is STILL present in the same manner.

Cisco Employee

Re: Trouble installing PyATS + Genie on Ubuntu

currently, Genie requires python virtual environment. could you please check if you install pyats/genie in python virtual environment?

 

mkdir pyats
cd pyats
python3 -m venv .
source bin/activate
pip install pyats genie

 

Beginner

Re: Trouble installing PyATS + Genie on Ubuntu

Looks like it didn't create the init file for the genie_yaml.

 

Try the following and see if the cli genie command works.

 

sudo mkdir /usr/genie_yamls/ && touch /usr/genie_yamls/__init__.py 

Then from cli:

genie -h
Highlighted
Beginner

Re: Trouble installing PyATS + Genie on Ubuntu

Aloha,

I had the same problem.

 

We have a shared Link server, where multiple users are using Ansible and want to use the same environment (playbooks)

OS is CentOS 7

We like to use Genie and the Ansible Genie module for all users

 

Installation of Genie was done with the command:

sudo /usr/local/bin/pip install genie

And Genie is installed to /usr/local/bin

not /usr/bin

 

 

which genie
/usr/local/bin/genie

 

So the  genie_yamls directory is installed under /usr/local/:

ll /usr/local/genie_yamls/
total 160K
-rw-r--r-- 1 root root  990 May 28 15:28 __init__.py
drwxr-xr-x 2 root root   75 May 28 15:28 ios/
drwxr-xr-x 2 root root   79 May 28 15:28 iosxe/
drwxr-xr-x 2 root root   73 May 28 15:28 iosxr/
drwxr-xr-x 2 root root   79 May 28 15:28 junos/
drwxr-xr-x 2 root root   77 May 28 15:28 nxos/
-rw-r--r-- 1 root root 6.4K May 28 15:28 pts_datafile.yaml
drwxr-xr-x 2 root root   36 May 28 15:28 __pycache__/
-rw-r--r-- 1 root root 1.3K May 28 15:28 subsection_datafile.yaml
drwxr-xr-x 3 root root   35 May 28 15:28 tools/
-rw-r--r-- 1 root root  64K May 28 15:28 trigger_datafile.yaml
-rw-r--r-- 1 root root  77K May 28 15:28 verification_datafile.yaml

But Genie is expecting it at:

genie -v
..
..
No such file or directory: '/usr/genie_yamls/__init__.py'

Im not a Linux expert, but I read, that local installations never should be in systems folders like

/usr/bin

 

But more important,

how to get it working, so that all users can use Genie?

 

Thanks

Marcel

Cisco Employee

Re: Trouble installing PyATS + Genie on Ubuntu

currently, Genie requires python virtual environment. could you please check if you install pyats/genie in python virtual environment?

 

mkdir pyats
cd pyats
python3 -m venv .
source bin/activate
pip install pyats genie
Beginner

Re: Trouble installing PyATS + Genie on Ubuntu

Aloha.
Many thanks for the hint!
But is it possible to use PyATS I’m the in a multiuser environment?
We have a server, with a shared ansible environment and want to use one PyATS and Genie installation for all users
Thanks
Marcel
CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards