Pip packages path - windows

拟墨画扇 提交于 2020-01-25 06:41:48

问题


I have pip install <package name> installing the packages to AppData/Python/Python36/Scripts folder. How do I know the exact path to this folder from Command line?

I tried doing py -m site --userbase This is showing AppData/Roaming/Python/Python36 which does not exist. How will I get to know the path without actually doing manual search?

PS : I am writing an automation script to install pip and awscli later. After I install pip, I face command not found error. So looking how to set path directly from a script without having to face the issue of manually setting it. Found out that pip.exe and aws.exe are under AppData/Python/Python36/Scripts. My question is how do I get this path from inside a script.


回答1:


Here's how to obtain the requested result:

python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"



回答2:


Verify a successful installation by opening a command prompt window and navigating to your Python installation's script directory (default is C:\Python27\Scripts). Type pip freeze from this location to launch the Python interpreter.

https://github.com/BurntSushi/nfldb/wiki/Python-&-pip-Windows-installation



来源:https://stackoverflow.com/questions/49028533/pip-packages-path-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!