Python can't locate distutils_path on Mac OSX

前端 未结 5 881
慢半拍i
慢半拍i 2021-02-01 18:54

I\'ve been using virtualenv + pip for python development. I\'m not sure what happened, but suddenly whenever I try to run a command-line tool or import libraries, I get this er

5条回答
  •  攒了一身酷
    2021-02-01 19:36

    I have used a similar approach of Nat Goodspeed.

    But I've copied all *.py files.

    Download the same version of your system python, 2.7.2 in my case:

    $ python --version
    

    Download it and unpack it. http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2

    # -n copy only missing files, -r recursively
    $ sudo cp -rn ~/Downloads/Python-2.7.2/Lib/* /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/
    

提交回复
热议问题