例如,如果在使用 pip 安装 Tornado 之后,如下所示:
pip install tornado
Collecting tornado
...
Successfully installed backports-abc certifi singledispatch six tornado
pip freeze
不返回列表中的 Tornado 包,它只显示:PyMySQL==0.7.2
也当我跑
easy_install
它返回:error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/lib/python2.7/site-packages/
and your PYTHONPATH environment variable currently contains:
''
出了什么问题?
最佳答案
当使用 virtualenvwrapper 或其他虚拟环境(这可能不是你的情况,但我是如何解决这个问题的)时,你可能已经使用 sudo
安装了东西。这将为您的整个系统安装它们。 ( See here )
因此,pip freeze
实际上正在工作,只是您实际上还没有使用该 pip 安装任何东西。
关于python - pip freeze 不显示包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38638487/