目前我在ubuntu(linux)上有一个以root用户身份运行的网站,因此我希望将其转换为具有root权限的普通用户。
因此创建了一个具有root权限的新用户,并将所有必需的东西(代码,文件夹)从root用户复制到普通用户,包括virtualenvs文件夹
现在,当我尝试在新用户上创建新的虚拟环境时,我遇到了错误
mkvirtualenv hello
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 824, in main
symlink=options.symlink)
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 984, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 1158, in install_python
mkdir(lib_dir)
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 447, in mkdir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: 'hello'
我们怎样才能纠正这个问题?