Upgraded Python; Do I have to reinstall all site-packages manually?

前端 未结 3 466
心在旅途
心在旅途 2020-12-17 17:44

I have upraded my Linux distro recently. Python 3.5 was replaced by Python 3.6.

All site packages I have installed with pip3 are still in the /usr

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-17 18:05

    I just hit the same problem upgrading from Python 3.6 to Python 3.7, I forgot to run pip freeze before I upgraded to Python 3.7. The solution that worked is to specify the --path option as the old site-packages/ directory (which was not deleted):

    pip3 freeze --path /usr/local/lib/python3.6/site-packages/ > python3.6_requirements.txt
    pip3 install -r python3.6_requirements.txt
    

提交回复
热议问题