1

I am trying to create a very simple Python 3.6 script. Using MacOS.

For this script I had to install robobrowser, which I installed with easy_install robobrowser. After that I try to import it with the following statements:

import re
from robobrowser import RoboBrowser

However, terminal prompted me with the following (infamous) error:

Traceback (most recent call last):
  File "signup.py", line 2, in <module>
    from robobrowser import RoboBrowser
ModuleNotFoundError: No module named 'robobrowser'

I have installed Python 3.6. However, in my /Library/Python I only have 2 folders: 2.6 and 2.7. In /Library/Python/site-packages there is a folder named robobrowser-0.5.3-py2.7.egg. Might it have something to do with this?

Sorry for asking a most likely easy question. I can however not seem to figure it out.

Thanks for reading this,

Thijmen.

Thijmen
  • 374
  • 2
  • 14
  • Try to find folder robobrowser on site-packages folder inside python lib folder – Ezequiel Bertti Sep 28 '17 at 21:04
  • There is a robobrowser-0.5.3-py2.7.egg in /Library/Python/site-packages. Is this what you mean? – Thijmen Sep 28 '17 at 21:07
  • No, this egg is just a metadata about the package. You must see `which` command for your pip, if this on python2 or python3. I think this is on python2. PS: I create a virtualenv and install in my pc, using python3 and works fine. – Ezequiel Bertti Oct 03 '17 at 13:19
  • Possible duplicate of [Can't find the modules that have been installed by pip](https://stackoverflow.com/questions/52220670/cant-find-the-modules-that-have-been-installed-by-pip) – Baum mit Augen Nov 12 '18 at 14:17

2 Answers2

-1

Probably you are using easy_install for Python2. The best solution is to install pip for Python3 and run pip install robobrowser

amarynets
  • 1,765
  • 10
  • 27
  • I have tried that. Unfortunately it does not work. Is it strange that there is no Python 3.6 folder? – Thijmen Sep 28 '17 at 21:08
-1

This must be because you have multiple versions of Python installed, and when you installed robobrowser, it got installed to a different python version than the one you are trying to use. If you want to use it with Python 3, make your $PATH variable use the Python3's Scripts path instead of the one from Python2. Or a simpler way is to install pip3 on your computer and do sudo pip3 install robobrowser

For reference: changing python path on mac?

You can run the which python, which python3 and which easy_install commands in your terminal to find which versions of python and easy_install are being used by default.

Siddardha
  • 510
  • 1
  • 7
  • 17