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.

asked Sep 28, 2017 at 20:58
4
  • Try to find folder robobrowser on site-packages folder inside python lib folder Commented Sep 28, 2017 at 21:04
  • There is a robobrowser-0.5.3-py2.7.egg in /Library/Python/site-packages. Is this what you mean? Commented Sep 28, 2017 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. Commented Oct 3, 2017 at 13:19
  • Possible duplicate of Can't find the modules that have been installed by pip Commented Nov 12, 2018 at 14:17

2 Answers 2

-1

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

answered Sep 28, 2017 at 21:04
Sign up to request clarification or add additional context in comments.

1 Comment

I have tried that. Unfortunately it does not work. Is it strange that there is no Python 3.6 folder?
-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.

answered Sep 28, 2017 at 21:08

7 Comments

Thank you. Indeed, 'python --version' gives me 2.7.2 as output. However, any clue where is 3.6 installed? I can not find it in /library/python/.
You can try running which python3
This gives me /usr/local/bin/python3 as output. However this is not a directory I can open with Finder. Sorry for being such a noob. Trying my best :-)
You can go there by typing sudo cd /usr/local/bin/python3 in your terminal. My suggestion is install pip3 on your computer and do pip3 install robobrowser
It says /usr/local/bin/python3 is not a directory.
|

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.