0

Nube at Python but application I want to use is written in it and I am having trouble getting this application to work.

I have been searching for answers but perhaps don't know enough to ask the right questions.

I am running windows 10 (new to it also). I have installed Python 3.10.1 from the Windows store. It is in the path statement and does execute from cmd prompt.

As my application uses YAML I have also installed PyYaml, I have no idea if it installed correctly, where it is installed and it is not in the PATH.

My application called wireviz.py is launched from its source folder by typing wireviz -V. It fails at line 10 with ModuleNotFoundError: No module named 'yaml'.

 1  #!/usr/bin/env python3
 2  # -*- coding: utf-8 -*-
 3
 4  import argparse
 5  import os
 6  from pathlib import Path
 7  import sys
 8  from typing import Any, Tuple
 9
10  import yaml

I know much more may be needed, but frankly I don't know what and maybe even how to get it.

martineau
  • 119,623
  • 25
  • 170
  • 301
  • From command line (make sure python is added to path) `pip install ` e.g. `pip install yaml` (assuming that is the library name). https://pip.pypa.io/en/stable/cli/pip_install/ also take a look at this [Q&A](https://stackoverflow.com/questions/6318156/adding-python-to-path-on-windows) – Danny Varod Dec 20 '21 at 17:13
  • Use `pip install pyyaml` as stated at the very beginning of its [documentation](https://pyyaml.org/wiki/PyYAMLDocumentation). – martineau Dec 20 '21 at 18:31
  • I have used pip install pyyaml and it worked as pip list shows it. I still get the same error. pyyaml nor yaml are not in path where did it get installed? Also what does the import module need to be. Is it yaml.py or a folder called yaml? I know these are basic questions but I am not a Pylon programmer I just want my app to work. – Robert Workman Dec 21 '21 at 15:29

2 Answers2

0

The error message indicates that PyYAML is not installed; since PyYAML is registered under the Python Package Index (PyPI) as yaml, you should install it using pip (the Python package installer). The command might look like this:

pip install yaml

There are many more nuances to learn about package installation, but for the time being this should get you up and running.

0

Problem solved thanks to Austin advise. Because of it I did some research on Python Installer to get a better feel for the process. Found my stuff was installed all over the place. Found a pip package for my application so I deleted everything including Python and did a fresh install of Python and the "Graphviz" applications. Then installed my application (WireViz.py) using pip install. Application and all required modules installed without error and after checking PYTHONPATH, everything is now working. Thanks for the help.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 31 '21 at 22:39