Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 之 pip 与 pip3 #84

Open
alwaystest opened this issue Jan 4, 2019 · 0 comments
Open

Python 之 pip 与 pip3 #84

alwaystest opened this issue Jan 4, 2019 · 0 comments

Comments

@alwaystest
Copy link
Owner

alwaystest commented Jan 4, 2019

Python 之 pip 与 pip3

标签(空格分隔): Python


配置 Spf13-vim 的时候发现在打开 py 文件的时候总是报错,找不到 module six。

使用 pip install six安装后依然无法找到 module
使用 pip3 install six 安装后依然无法找到 module

which pip3 发现 pip3 的路径居然是 /Users/xxx/Library/Python/2.7/bin
pip3 --version 也能明显看到路径在 Phthon2 下面

pip 18.1 from /Users/xxx/Library/Python/2.7/lib/python/site-packages/pip (python 2.7)

echo $PATH 发现 path 前部设置了 python 2.7 的路径,所以在寻找可执行文件的时候优先找到了 python 2.7 下面的 pip 和 pip3,导致直接屏蔽掉了 Python3 下的 pip3

并且 python 2 下的 pip3 是一个 Python 脚本,声明了使用 Python 执行,当 Python 指向 Python 2 的时候,实际调用的 Pip 就是 Python 2 的 Pip,如果把 pip3 的声明修改为 Python3。调用 pip3 --version 就会显示 Python 3 的 Pip

之前一直以为 pip3 是给 Python3 专用的,现在看起来不是这样子的。

还是 pyenv 好用,这种低级的环境变量问题居然排查了这么久。

另外遇到一个小问题。

使用 pyenv 安装 Python 的时候 遇到 zlib 无法使用的问题。许多老的答案都说运行一次 xcode-select --install 就好了,但是在 Mojave 上还需要运行一遍这个命令 sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

这里找到的答案

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant