Friday, 24 November 2017 11:18

[solved] How to install pip, BS4(Beautiful Soup), and update Python v2.7 to v3 on Mac

Written by
Rate this item
(1 Vote)

MacOS comes with Python installed. But to make sure that you have Python installed open the terminal and run the following command.

python --version

If this command returns a version number that means Python exists. Which also means that you already have access to easy_install considering you are using macOS/OSX. Now, all you have to do is run the following command.

sudo easy_install pip

After that, pip will be installed and you'll be able to use it for installing other packages. For try if pip working well use:

pip --version

If you want install another modules - you can do this, for example:

pip install regex

Then runing

sudo pip3 install beautifulsoup4
Read 8883 times Last modified on Friday, 24 November 2017 11:44
Alex

Experienced Web Developer with a demonstrated history of working in the information technology and services industry.

Skilled in User Experience, Magento, Joomla, WordPress and IT Services.

Related items

  • [ solved ] How to upgrade Python 2.7 to Python 3 on your Mac

    You can even run Python3 alongside a concurrent Python 2.7 installation without affecting the version 2.7 installation.

    How we can do it?

    1. Download the most recent package from the Python website and install latest package on your Mac.

    2. Run terminaland write a command:

    $ python --version
    Python 2.7.6
    
    $ python3 --version
    Python 3.9.6
    
    $ alias python=python3
    $ python --version Python 3.9.6 #here your version latest to Python

     In regards to deleting the symbolic links Python2.7, I found this to be useful.

    find /usr/local/bin -lname '../../../Library/Frameworks/Python.framework/Versions/2.7/*' -delete

     Now job done, try write in terminal $ python --version and you should be look Python 3.9.x

    Same situation with pip, if you write in terminal $pip list and look $bash pip: command not found

    Open the terminal and write

    $ alias pip=pip3
    
    $ pip --version
    pip 21.1.3 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)

     Jobe done and now you can write pip or pip3 - it's same like simlink.

  • How to change your version of your Mac OS?
    in Mac
    • Open Terminal and enter
      sudo nano /System/Library/CoreServices/SystemVersion.plist

      and enter your admin password.
    • Change the two strings "10.11" to "10.12". Leave the minor version number (e.g. 0, 1, 2...) like it is. Hit ctrlO and Enter to write the file to disk.
    • Hit ctrlX to quit nano
  • How to change screenshot format png → jpg
    in Mac

    To save screenshots in JPG, execute the following commands in the terminal:

    defaults write com.apple.screencapture type jpg;killall SystemUIServer

    macOS also support: tiff, pdf, bmp & pict.

  • Launch Sublime Text 3 from the command line & simlink to Subl
    in Mac

    These instructions assume you’re using the Terminal app out of the box, without ZSH or any fancy prompts like that. I trust you will be able to adapt these instructions yourself if you do.

    Step 1 : Create a symlink called sublime

    sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime

    Step 2 : Check that your system profile can find the symlink you just created.

    open ~/.bash_profile

    Step 3 : Add both these lines & then save the file :

    alias subl="open -a /Applications/Sublime\ Text.app"
    
    export PATH=/usr/local/bin:$PATH

    Step 4 : Reload your bash_profile :

    source ~/.bash_profile

    Done ! You can now navigate to any of your code/script folders in Terminal and open them in Sublime with the following commands :

    subl .
    subl .zshrc
  • How to Stop .DS_Store File Creation on Network Volumes in Mac OS X
    in Mac

    To disable the creation of .ds_store files, launch the Terminal application from /Applications/Utilities/ and enter the following command string exactly:

    defaults write com.apple.desktopservices DSDontWriteNetworkStores true

    Reboot the Mac for changes to take full effect.