python - 如何正确地将“脚本轮”添加到 python 路径?
问题描述
我刚刚从python.org安装了 Python 3.7 。我按照这个StackOverflow 帖子将我的默认 Python 更改为 Python 3。从那里我运行了 Update Shell Profile.command 和 Install Certificates.command(Finder > Applications > Python 3.7)。
然后我发现我无法运行 pip 命令
> $ pip --version
> -bash: pip: command not found
随后我运行了以下2个命令..
> $ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
>
> $ python get-pip.py
Collecting pip
Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 5.5MB/s
Collecting wheel
Downloading https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl (41kB)
100% |████████████████████████████████| 51kB 12.1MB/s
Installing collected packages: pip, wheel
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Consider using the `--user` option or check the permissions.
然后我添加了--user
标志
> $ python get-pip.py --user
>
> Collecting pip Using cached
> https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl
> Collecting wheel Using cached
> https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl
> Installing collected packages: pip, wheel
这是我不明白的
> The script wheel is
> installed in '/Users/kevinturney/Library/Python/2.7/bin' which is not
> on PATH.
> Consider adding this directory to PATH or, if you prefer to
> suppress this warning, use --no-warn-script-location.
什么是轮子,如何将其添加到正确的路径?
> $ which python
> /usr/local/opt/python/libexec/bin/python
什么是轮子,如何将其添加到正确的路径?
解决方案
推荐阅读
- javascript - 如何模拟 Cypress.io 中丢失的窗口焦点
- php - 在学说实体中访问 OneToMany 关系时未定义的索引
- gradle - 在 Android Studio 中包含和排除不同风格的源集
- android - Android Studio 抱怨缺少 JNI 类
- c - 有没有更好的方法来写入设备文件而不是多次写入?
- javascript - 未调用 Shopware 插件 javascript 事件
- vba - excel vba工作日功能
- c# - Windows 10 Pro -version 1803 蓝牙配置文件访问
- javascript - 计算动态添加到表中的项目的总和
- python - 在networkx中以最小成本通过所有节点的流量