-2

I am new to Python and today I received a Python 2 script and would like to run it. Never worked with Python, but the code looks straight forward. The issue is, that right at the beginning there is:

import requests, sys, os, re
import unicodecsv as csv
from lxml import html
from bs4 import UnicodeDammit
from lxml import etree

And I'm not sure how to install these dependencies. I googled around and figured that some 'requirements.txt' file would help, but I have not received it.

So how or whats the best way to install these dependencies please?

jar
  • 2,646
  • 1
  • 22
  • 47
Oliver Goossens
  • 1,903
  • 3
  • 20
  • 26
  • 1
    `pip install requests` for "requests" library – jar Nov 10 '18 at 17:10
  • `pip install beautifulsoup4` for "bs4". `pip install lxml` for "lxml". `pip install unicodecsv` for "unicodescv" – jar Nov 10 '18 at 17:15

1 Answers1

0

Thank you for the comments.

Looks like pip is the package manager so to speak for Python and the packages you stated worked.

pip install requests
pip install beautifulsoup4
pip install lxml
pip install unicodecsv

Thank you again!

Oliver Goossens
  • 1,903
  • 3
  • 20
  • 26