Python Forum

Full Version: About .profile and ImportError: No module named
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
ImportError: No module named

This error has been a hindrance in the last 24 hours for this start of walk with Python.

Already tried:
from bs4 import beautifulsoup4
and
import beautifulsoup4

I'm working on a MacOS version 10.13.6
I have 2 Python installed, the original MacOS and Python3.7.
 

In Terminal, when I type pip3.7 list, the library that I need appears:



Package Version
-------------- ---------
beautifulsoup4 4.6.3



In the .profile file, it says:
/ Usr / bin / bin / usr / bin / bin / usr / sbin / sbin / bin / usr / bin / usr / bin /
export PYTHONPATH



Honestly, it seems unbelievable that this error persists.

If anyone can help me?

Libraries in Python 2 are imported normally, without error.

thankful
Use proper tags when post code, traceback, output, etc.
See BBcode help for more info.
Also, when post traceback, ALWAYS post the full traceback you get, in error tags.
(Aug-28-2018, 12:45 AM)RicardoAbdala Wrote: [ -> ]Libraries in Python 2 are imported normally, without error.
Did you install bs4 also for python3.7? If not - you installed it only for python2. You need to install external packages in the python installation you want to use them with.
By the way it's from bs4 import BeautifulSoup