问题
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