Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Ubuntu Server in VirtualBox. I am trying to install VirtualEnv to start learning Flask and bottle. Some details of my setup.

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:~$

When I boot my Virtual Machine, I get the following error on my console

/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.

When i try to initialize a virtualenv I get the following errors

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$ 

My .bashrc entries

export WORKON_HOME='~/dropbox/venv/'
source '/usr/local/bin/virtualenvwrapper.sh'

Q1 - As per the error at bootup, How do I ensure virtualenv is installed for VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is set properly ?
Q2 - Even with sudo I get the same "Read-only file system" Error ?

I have tried installing virtualenv using pip and then apt-get, just to hit and try.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Your trying to install a virtualenv on a mountpoint that does not support symbolic links . If you look at the output of mount you will see has some mountpoint at /home/yourusername/dropbox. Try a different location, such as your home directory:

cd 
virtualenv --python=python2.7 flaskenv

(note: currently flask only works on python 2)

There is no point syncing the vritualenv on dropbox anyway. It won't work on another system unless its identical. You can sync between virtualenvs using pip requirements.txt files .

share|improve this answer
    
thanks guysoft. I will try this out. And extra thanks for sync tip. –  Vivek Sharma May 27 '13 at 9:05
    
Ok, seems like you can only run flask on python 2. According to this issue opened in their github. You must use virtualenv --python=python2.7 flaskenv. Updated the answer to include this. –  GuySoft May 28 '13 at 8:26
    
Thank you very much GuySoft. I was able to install Flask. –  Vivek Sharma May 29 '13 at 3:17
    
GuySoft, can you please help here. stackoverflow.com/questions/16811586/… –  Vivek Sharma May 29 '13 at 13:21
    
Vivek Sharma, No Idea about that. Not that much experience with Flask yet. –  GuySoft May 30 '13 at 11:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.