mac上使用pipenv管理虚拟环境时,安装包的时候报错;虽然install成功,locking到lock文件的时候失败:
![8ed9c4ee525c9346f9476bef1f14c9d9.png](https://i-blog.csdnimg.cn/blog_migrate/b74b2fbe71e5ef95985b3a4a5528a0ea.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