how to solve “bad interpreter: Too many levels of symbolic links”

前端 未结 6 1920
野趣味
野趣味 2020-12-09 20:25

I am trying to install numpy in a virtual environment that I created. I used the following series of commands to create and activate and then installing a local version of n

6条回答
  •  不思量自难忘°
    2020-12-09 20:56

    I had this. In my case I am not sure what happened but my python2 had been replaced by a link so I had:

    ls -l
    lrwxrwxrwx 1  staff    7 Oct 23 14:04 python -> python2
    lrwxrwxrwx 1  staff    6 Nov  6 14:28 python2 -> python
    lrwxrwxrwx 1  staff    7 Oct 23 14:04 python2.7 -> python2
    

    The middle link is wrong, this is a circual reference, it should be the executable (had another venv to look at already). I deleted python2 and copied the actual file (in my case /bin/python2.7) to there:

    rm python2
    cp /bin/python2.7 python2
    ls -l
    lrwxrwxrwx 1  staff    7 Oct 23 14:04 python -> python2
    -rwxr-xr-x 1  staff 7216 Dec  6 14:57 python2
    lrwxrwxrwx 1  staff    7 Oct 23 14:04 python2.7 -> python2
    

    (NOTE: I can't speak for every distro. you'll need to work out your own version. Try this:

    ls -l `which python`
    

    and if that is a link follow it until you get to the actual executable. For me is was /bin/python -> python2 -> python2.7. Ergo I copied /bin/python2.7)

提交回复
热议问题