简体   繁体   中英

Python 3.5.1 Pip install error on mac

Installed Python 3.5.1 on Mac. When I try to download a module from Python's standard library such as pip install BeautifulSoup, I receive the error below:

Collecting BeautifulSoup

Using cached BeautifulSoup-3.2.1.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/private/var/folders/bz/2h0jcnq54pzcvjp2x0mhrc6r0000gn/T/pip-build-b_z00926/BeautifulSoup/setup.py", line 22 print "Unit tests have failed!" ^ SyntaxError: Missing parentheses in call to 'print'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/bz/2h0jcnq54pzcvjp2x0mhrc6r0000gn/T/pip-build-b_z00926/BeautifulSoup/

That appears to be an old version of BeautifulSoup. Try this instead:

pip install beautifulsoup4

the missing parentheses part might suggest that pip uses python2 by default when you actually need python3

a simple workaround:

python3 -m pip install beautifulsoup # or beautifulsoup4

that has the same effect as pip install, but explicitly specifies which python to use

Try using pip2 (for Python 2) or pip3 (for Python 3) instead of just pip . It might be using the wrong version of pip for the Python version you are trying to use.

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