I'm trying to install html2text and I've used sudo pip install html2text but I get the error ImportError: No module named 'html2text'
I'm not sure if i need to install any things before doing the html2text install command. I'm very new to Python. I'm using Python 3.5. (Using Mac)
3 Answers
you can download source from https://pypi.python.org/pypi/html2text , then extract archive
tar -xvf html2text-2015.11.4.tar.gz
and install with
python setup.py install
Comments
You can download from the official site. There is a .zip and .tar.gz available, download what you prefer, extract it and check the Readme or something similar to install properly.
I have just try this in python 2 and it worked fine
mkdir new_directory
cd new_directory
virtualenv venv
source venv/bin/activate
pip install html2text
I have firstly created a directory. In this directory I have created a virtual environment using virtualenv (sudo apt-get install python-virtualenv). I active the virtual environment typing source/venv/bin/activate. When the virtual environment is activated, I just install html2text.
This install html2text in a virtual environment so you couldn't use it without activate the virtual environment.
For Python 3 you could try with pip install python3-html2text or download from this site
7 Comments
cd into the directory and sudo python setup.py install, if this doesn't work, try with sudo python setup.py build firstLocation: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packagespip install python3-html2txt or pip install python-html2txt, launchpad.net/ubuntu/+source/python-html2text
pip? Sometimespiprefers topython 2if both are installed on the system. Then you can trypip3.pip 7.1.2 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (python 2.7)I'm a real noob with the terminal and everything, only started 3 days ago.expertstarts fromnoob. I am still a noob. I think you can see that thepipbelongs to2.7. Have you tried usingpip3instead?pip3orpython3etc in/Library/Frameworks/Python.framework/Versions/3.4/bin/sudo pip3 install html2textand it worked! But how do i use html2text? I'm making a program that reads the website for a word. I want to use html2text like this -url = input()html2text(url)how can i do that? Or if not possible i could use something like -content = url.read()html2text(content)?