In my virtualenv, I need to use sudo for all commands

前端 未结 2 1889
小蘑菇
小蘑菇 2021-02-08 20:50

I set up a virtualenv, which is working, but for some reason I need to use sudo for commands as simple as mkdir. Obviously I did something

2条回答
  •  离开以前
    2021-02-08 20:53

    The commands

    cd test
    sudo virtualenv python
    

    creates a directory called python which is owned by root.

    drwxr-xr-x 5 root   root      4096 2010-04-17 11:40 python
    

    That would force you to use sudo for simple things like making a directory inside the python directory.

    The fix would be to delete the python directory (saving data first if necessary) and issue the command

    virtualenv python
    

    without the sudo.

提交回复
热议问题