0

I am currently trying to use my YAML file but I get an error when trying to run my programme when it reaches 'import yaml' line.

The error is shown below

ImportError: No module named yaml

Even though I was able to successfully install it

Collecting pyyaml
Installing collected packages: pyyaml
Successfully installed pyyaml-3.13

Any help would be great, thanks

DonalDraper
  • 5
  • 1
  • 4

1 Answers1

0
which python

/home/user/anaconda3/bin/python

which pip

/home/user/anaconda3/bin/pip

These must match. Than you can run pip install PyYAML


For such problems I can recommend conda. Using conda all dependencies are matched.

Here is a description how to use environments with conda.

The good thing about this approach is that you can change the version of your software (e.g. python) at any time, not affecting your other projects.

Moreover you can use pip in it just as before.

ohlr
  • 1,839
  • 1
  • 13
  • 29