I'm trying to do a pip freeze -l > requirements.txt
. I'm running this in a virtualenv. However, even with the -l
option, pip freeze
gives me a list of all the packages installed in my system, which is a huge and unnecessarily long list. All I need are Flask and a few other libraries, but this is the list it gives me:
altgraph (0.10.2)
bdist-mpkg (0.5.0)
beautifulsoup4 (4.5.3)
bonjour-py (0.3)
cachetools (2.0.1)
certifi (2017.7.27.1)
chardet (3.0.4)
click (6.7)
Flask (0.12.1)
futures (3.1.1)
google (1.9.3)
google-api-python-client (1.6.4)
google-auth (1.2.0)
google-auth-httplib2 (0.0.2)
google-auth-oauthlib (0.1.1)
gunicorn (19.7.1)
httplib2 (0.10.3)
idna (2.6)
itsdangerous (0.24)
Jinja2 (2.9.6)
macholib (1.5.1)
MarkupSafe (1.0)
matplotlib (1.3.1)
modulegraph (0.10.4)
numpy (1.12.1)
oauth2client (4.1.2)
oauthlib (2.0.6)
pbr (2.0.0)
pip (9.0.1)
psycopg2 (2.7.3.2)
py2app (0.7.3)
pyasn1 (0.3.7)
pyasn1-modules (0.1.5)
pyobjc-core (2.5.1)
pyobjc-framework-Accounts (2.5.1)
pyobjc-framework-AddressBook (2.5.1)
pyobjc-framework-AppleScriptKit (2.5.1)
pyobjc-framework-AppleScriptObjC (2.5.1)
pyobjc-framework-Automator (2.5.1)
pyobjc-framework-CFNetwork (2.5.1)
pyobjc-framework-Cocoa (2.5.1)
pyobjc-framework-Collaboration (2.5.1)
pyobjc-framework-CoreData (2.5.1)
pyobjc-framework-CoreLocation (2.5.1)
pyobjc-framework-CoreText (2.5.1)
pyobjc-framework-DictionaryServices (2.5.1)
pyobjc-framework-EventKit (2.5.1)
pyobjc-framework-ExceptionHandling (2.5.1)
pyobjc-framework-FSEvents (2.5.1)
pyobjc-framework-InputMethodKit (2.5.1)
pyobjc-framework-InstallerPlugins (2.5.1)
pyobjc-framework-InstantMessage (2.5.1)
pyobjc-framework-LatentSemanticMapping (2.5.1)
pyobjc-framework-LaunchServices (2.5.1)
pyobjc-framework-Message (2.5.1)
pyobjc-framework-OpenDirectory (2.5.1)
pyobjc-framework-PreferencePanes (2.5.1)
pyobjc-framework-PubSub (2.5.1)
pyobjc-framework-QTKit (2.5.1)
pyobjc-framework-Quartz (2.5.1)
pyobjc-framework-ScreenSaver (2.5.1)
pyobjc-framework-ScriptingBridge (2.5.1)
pyobjc-framework-SearchKit (2.5.1)
pyobjc-framework-ServiceManagement (2.5.1)
pyobjc-framework-Social (2.5.1)
pyobjc-framework-SyncServices (2.5.1)
pyobjc-framework-SystemConfiguration (2.5.1)
pyobjc-framework-WebKit (2.5.1)
pyOpenSSL (0.13.1)
pyparsing (2.0.1)
python-dateutil (1.5)
pytz (2013.7)
requests (2.18.4)
requests-oauthlib (0.8.0)
rsa (3.4.2)
scipy (0.13.0b1)
setuptools (18.5)
SimpleCV (1.3)
six (1.11.0)
SQLAlchemy (1.1.15)
stevedore (1.21.0)
uritemplate (3.0.0)
urllib3 (1.22)
vboxapi (1.0)
virtualenv (15.1.0)
virtualenv-clone (0.2.6)
virtualenvwrapper (4.7.2)
Werkzeug (0.12.1)
wheel (0.30.0)
xattr (0.6.4)
zope.interface (4.1.1)
I have tried trouble-shooting this so that pip freeze -l
shows only the packages in my current virtualenv root. Here is what hasn't worked so far:
- Resetting the virtualenv using either
virtualenv --clear venv
orvirtualenv --no-site-packages venv
. - Trying to uninstall all local packages using
pip freeze | xargs pip uninstall -y
found at this answer here. I got the[Errno 1] Operation not permitted
error because for some reason even though I'm in the virtualenv it tried uninstalling the packages from the OS X root.
Any help would be appreciated, thanks.