VirtualBox 中的 Ubuntu 服务器。我正在尝试安装 VirtualEnv 以开始学习 Flask 和 Bottle。我的设置的一些细节。
vks@UbSrVb:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="12.04.2 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04.2 LTS)"
VERSION_ID="12.04"
vks@UbSrVb:~$ python --version
Python 2.7.3
vks@UbSrVb:~$ echo $VIRTUALENVWRAPPER_PYTHON
/usr/bin/python
vks@UbSrVb:~$ echo $VIRTUALENV_PYTHON
vks@UbSrVb:~$
当我启动我的虚拟机时,我的控制台上出现以下错误
/usr/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenv has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.
当我尝试初始化 virtualenv 时,出现以下错误
vks@UbSrVb:~/dropbox/venv$ virtualenv try1
New python executable in try1/bin/python3.2
Also creating executable in try1/bin/python
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 9, in <module>
load_entry_point('virtualenv==1.9.1', 'console_scripts', 'virtualenv')()
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 979, in main
no_pip=options.no_pip)
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 1081, in create_environment
site_packages=site_packages, clear=clear))
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 1499, in install_python
os.symlink(py_executable_base, full_pth)
OSError: [Errno 30] Read-only file system
vks@UbSrVb:~/dropbox/venv$ ls
try1
vks@UbSrVb:~/dropbox/venv$ ls try1/
bin include lib
vks@UbSrVb:~/dropbox/venv$
我的 .bashrc 条目
export WORKON_HOME='~/dropbox/venv/'
source '/usr/local/bin/virtualenvwrapper.sh'
Q1 - 根据启动时的错误,如何确保为 VIRTUALENVWRAPPER_PYTHON=/usr/bin/python 安装了virtualenv并且 PATH 设置正确?
Q2 - 即使使用 sudo 我得到相同的“只读文件系统”错误?
我尝试使用 pip 然后 apt-get 安装 virtualenv,只是为了尝试。