mac上使用pipenv管理虚拟环境时,安装包的时候报错;虽然install成功,locking到lock文件的时候失败:
![1f7c6612989757f0a910635916e67d52.png](https://i-blog.csdnimg.cn/blog_migrate/d2990396efabb843de7451f815cc1cfb.jpeg)
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Building requirements...
Resolving dependencies...
✘ Locking Failed!
ERROR: Could not find a version that matches (但前面提示安装成功了);
原因:
我的mac上同时存在brew安装的python和pyenv安装的python,造成了冲突。
解决方法:
卸载brew安装的python和pyenv:
brew uninstall python
rm -rf $(pyenv root)
brew uninstall pyenv-virtualenv # you may not have this installed, but...
brew uninstall pyenv
重新安装pyenv和python:
brew install pyenv
pyenv install 3.6.5 (or whatever version you want)
参考:
https://stackoverflow.com/questions/58280484/ssl-module-in-python-is-not-available-on-osx/60467942#60467942