just use virutalenv
plz just use it like so:
virtualenv --python /usr/bin/python2.7 --system-site-packages env
on new computer
brew install python brew install python@2 pip install --upgrade setuptools pip install --upgrade pip
"Executable scripts from Python packages you install will be put in
/usr/local/share/python, make sure it's on your PATH."
from .zshrc via oh-my-zsh:
Python modules have been installed and Homebrew's site-packages is not in your Python sys.path, so you will not be able to import the modules this formula installed. If you plan to develop with these modules, please run:
mkdir -p /Users/tyler/Library/Python/2.7/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >>
after that do something like this ~ (all of these work with pip3 & python3 as well, if one doesn't work try the other)
# my_parser.py !#/usr/bin/env python from bs4 import BeautifulSoup messy = """ <html><p> <em>ay </em> </p> </html> etc. """ BeautifulSoup.prettify()
pip install bs4 pip install beautifulsoup python parser.py
Add a directory to sys.path and process its .pth files. Typically used in sitecustomize or usercustomize (see above).
A list of strings that specifies the search path for modules. Initialized from the environment variable PYTHONPATH, plus an installation-dependent default.
This describes how to use .pth files to extend sys.path.