04-29-2019 08:28 AM
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
04-29-2019 09:45 AM
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.
06-18-2019 08:50 PM - edited 06-18-2019 08:53 PM
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
05-22-2019 09:09 AM
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
05-28-2019 07:45 AM
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
06-18-2019 08:54 PM
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
06-18-2019 11:35 PM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide