简体   繁体   中英

Python BeautifulSoup Mac Installation Error

I am completely new to all things programming. As I am working to learn the basics of Python, I have run into a problem that I've been unable to work through by reading and Googling.

I am trying to install BeautifulSoup, and I thought I had done so successfully, but when I try to test whether or not it's installed correctly I get an error.

I am using PyCharm and typed the following into the Python Console:

>>> from bs4 import BeautifulSoup

And I receive the following error:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: No module named 'bs4'

I read through a previous thread about a BeautifulSoup install error and one of the things that was mentioned was to check the preferences settings in PyCharm to ensure that it's using the right version of Python . . .

PyCharm项目口译员截图

Anyway, I can't seem to figure out what's wrong, so any insight and help in resolving this issue would be tremendously appreciated.

You can use pip to install beautifulsoup on mac, by typing in the following command in Terminal:

pip install beautifulsoup4

You might be facing some permission problems if you are running the OS X preinstalled python as interpreter. I would suggest installing python with Homebrew if that's the case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM