Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named 'termcolor' #9

Closed
mathiasleroy opened this issue Apr 25, 2016 · 11 comments
Closed

ImportError: No module named 'termcolor' #9

mathiasleroy opened this issue Apr 25, 2016 · 11 comments

Comments

@mathiasleroy
Copy link

mathiasleroy commented Apr 25, 2016

It says "ImportError: No module named 'termcolor'"
While it said just before "Successfully installed termcolor"

:~/workspace/EmailHarvester (master) $ sudo pip install -r requirements.txt --user
Requirement already satisfied (use --upgrade to upgrade): termcolor in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): colorama in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 3))
Cleaning up...

:~/workspace/EmailHarvester (master) $ ./EmailHarvester.py -d teslamotors.com -e all
Traceback (most recent call last):
  File "./EmailHarvester.py", line 42, in <module>
    from termcolor import colored
ImportError: No module named 'termcolor'


:~/workspace/EmailHarvester (master) $ pip install -r requirements.txt --user
Requirement already satisfied (use --upgrade to upgrade): termcolor in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): colorama in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 3))
Cleaning up...

:~/workspace/EmailHarvester (master) $ ./EmailHarvester.py -d teslamotors.com -e all
Traceback (most recent call last):
  File "./EmailHarvester.py", line 42, in <module>
    from termcolor import colored
ImportError: No module named 'termcolor'
@liar666
Copy link

liar666 commented Apr 25, 2016

I had the same problem... Had multiple python installed: 2.7 3.4 & 3.5.

Forcing use of 2.7 did the trick here...(either by running "python2.7 EmailHarvester.py ..." or changing EmailHarvester shebang with "#!/usr/bin/env python2.7")

@maldevel
Copy link
Owner

you have to use python 3.x and also install the requirements for python 3.x not 2.7

@mathiasleroy
Copy link
Author

How do you "install the requirements for python 3.x not 2.7"?

@liar666
Copy link

liar666 commented Apr 25, 2016

That's probably a very basic info for python devs, but I would be interested in the answer too, as following the README's instructions (https://github.com/maldevel/EmailHarvester#downloadinstallation) led me to a wrong install. I tried using pip2, but with no more luck.
BTW I'm using python2.7 and everything works fine :)

@mathiasleroy
Copy link
Author

mathiasleroy commented Apr 25, 2016

I tried using python 2.7 like you suggested but it's not working

$ EmailHarvester.py -d example.com -e all                                                                                                                       
./EmailHarvester.py: line 27: 
    This file is part of EmailHarvester
    Copyright (C) 2016 @maldevel
    https://github.com/maldevel/EmailHarvester

    EmailHarvester - A tool to retrieve Domain email addresses from Search Engines.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    For more see the file 'LICENSE' for copying permission.
: No such file or directory
./EmailHarvester.py: line 29: __author__: command not found
./EmailHarvester.py: line 30: __copyright__: command not found
./EmailHarvester.py: line 31: __credits__: command not found
./EmailHarvester.py: line 32: __license__: command not found
./EmailHarvester.py: line 33: __version__: command not found
./EmailHarvester.py: line 34: __maintainer__: command not found
./EmailHarvester.py: line 37: import: command not found
./EmailHarvester.py: line 38: import: command not found
./EmailHarvester.py: line 39: import: command not found
./EmailHarvester.py: line 40: import: command not found
./EmailHarvester.py: line 41: import: command not found
./EmailHarvester.py: line 42: import: command not found
from: can't read /var/mail/termcolor
from: can't read /var/mail/argparse
from: can't read /var/mail/sys
from: can't read /var/mail/urllib.parse
./EmailHarvester.py: line 54: syntax error near unexpected token `class'
./EmailHarve

@liar666
Copy link

liar666 commented Apr 25, 2016

OK. Sorry for the wrong indication... I use Ubuntu with 3 versions of Python... Probably something is messed up in this installation and using explicitly python2.7 uses in fact (some parts of) python3x...

@mathiasleroy
Copy link
Author

found the solution

pip3 install -r requirements.txt --user

@Rosle23
Copy link

Rosle23 commented Apr 25, 2016

  1. manualy need to create folder /root/.local/lib/python3.4/site-packages
  2. copy site-packages from /root/.local/lib/python2.7/site-packages to /usr/local/lib/python3.4
  3. pip install --upgrade --target=/root/.local/lib/python3.4/site-packages colorama
  4. pip install --upgrade --target=/root/.local/lib/python3.4/site-packages tempcolor
  5. pip install --upgrade --target=/root/.local/lib/python3.4/site-packages requests

for me helped

@xprotector
Copy link

xprotector commented Jan 23, 2019

sudo apt-get install python-pip
sudo pip install termcolor

@NoName1488
Copy link

sudo apt-get install python-pip
sudo pip install termcolor

Thanks!

@zwein94
Copy link

zwein94 commented Jun 4, 2020

problem has been solved with me after uninstall all python versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants