I just want to say, I have already seen this question at Pip is already installed: but I am getting no module named lxml and have seen the one answer about installing it as non-root, that's what I did, and that did not help me.
I just installed lxml, here is how I installed it:
[ec2-user@ip-xxx-xx-xx-xxx newslookup]$ pip install --user lxml
Collecting lxml
Using cached https://files.pythonhosted.org/packages/89/51/a8a6cdb8a084d32dbc9bda94623dc35310ae2002be57de8702a1703c0026/lxml-4.3.3-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: lxml
Successfully installed lxml-4.3.3
So everything went well with the installation.
Here is the python script:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from lxml import html
import requests
from time import sleep
import json
import argparse
from random import randint
Here is the output when I run the script:
[ec2-user@ip-xxx-xx-xx-xxx newslookup]$ python3 nasdaq_scrape_sec.py aapl
Traceback (most recent call last):
File "nasdaq_scrape_sec.py", line 4, in <module>
from lxml import html
ModuleNotFoundError: No module named 'lxml'
Additionally, I can't find a wheel installation for this.