Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

virtualenv returns error 'Operation not Permitted'

I was using the command virtualenv --no-site-packages django-env but I encountered the following error

Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==12.0.7', 'console_scripts', 'virtualenv')()
  File "/usr/local/lib/python2.7/dist-packages/virtualenv-12.0.7-py2.7.egg/virtualenv.py", line 825, in main
    symlink=options.symlink)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv-12.0.7-py2.7.egg/virtualenv.py", line 985, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/usr/local/lib/python2.7/dist-packages/virtualenv-12.0.7-py2.7.egg/virtualenv.py", line 1416, in install_python
    os.symlink(py_executable_base, full_pth)
OSError: [Errno 1] Operation not permitted

So I thought using the command sudo virtualenv --no-site-packages django-env on my terminal to avoid any operating system conflicts, but it throws the following error please have a look at that

Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==12.0.7', 'console_scripts', 'virtualenv')()
  File "/usr/local/lib/python2.7/dist-packages/virtualenv-12.0.7-py2.7.egg/virtualenv.py", line 825, in main
    symlink=options.symlink)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv-12.0.7-py2.7.egg/virtualenv.py", line 985, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/usr/local/lib/python2.7/dist-packages/virtualenv-12.0.7-py2.7.egg/virtualenv.py", line 1204, in install_python
    copyfile(stdinc_dir, inc_dir, symlink)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv-12.0.7-py2.7.egg/virtualenv.py", line 479, in copyfile
    copyfileordir(src, dest, symlink)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv-12.0.7-py2.7.egg/virtualenv.py", line 454, in copyfileordir
    shutil.copytree(src, dest, symlink)
  File "/usr/lib/python2.7/shutil.py", line 208, in copytree
    raise Error, errors
shutil.Error: [('/usr/include/python2.7/numpy', 'django-env/include/python2.7/numpy', '[Errno 1] Operation not permitted')]

I am using Ubuntu 14.04 and Python 2.7.6

I am unable to figure what is causing the error.

like image 221
Chitrank Dixit Avatar asked Feb 21 '15 20:02

Chitrank Dixit


1 Answers

Regarding ownership of the development folder:

I had a similar error when running virtualenv on a virtualbox mounted drive. Switching over to a directory on the virtual machine ran fine.

All the best.

like image 71
QtlyOptmstc Avatar answered Oct 29 '22 08:10

QtlyOptmstc