Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

protocol error setting up virtualenvironment through vagrant on ubuntu

I'm trying to set up a virtualenv on Ubuntu 12.04 with Python 2.7 using vagrant but having same issues. it seems like this issues is seen only when "vagrant up" is issued from windows. what is the solution? any pointers?

New python executable in .vagrant-env/bin/python
  Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.11.6', 'console_scripts', 'virtualenv')()
  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 1404, in install_python
    os.symlink(py_executable_base, full_pth)
   OSError: [Errno 71] Protocol error
like image 249
user2574872 Avatar asked Jul 08 '14 20:07

user2574872


4 Answers

The solution is to use --always-copy. See here for the gory details.

like image 168
anatoly techtonik Avatar answered Nov 20 '22 09:11

anatoly techtonik


I found the issue and fixed it. Just start your git bash/cmd prompt console as an administrator. Then, vagrant up > setup your virtual env. It should be a cake walk.

Thanks Venkat

like image 18
Venkata Krishnan Avatar answered Nov 20 '22 10:11

Venkata Krishnan


This error can be fixed if you create the virtual env outside the /vagrant/ shared folder...

If go to the home folder of your vagrant user, you can create the virtualenv in there without this problem!

Just the venv must be out of this /vagrant/ directory... after that you can go work as usually activating this venv and working with your sorce code in the usual /vagrat/ shared dir...

like image 18
user1237092 Avatar answered Nov 20 '22 09:11

user1237092


Use this

virtualenv --python= <#Python path for specific version#> <#Folder name#> --always-copy

Example:

virtualenv --python=/usr/local/bin/python3.7 venv --always-copy

like image 3
Anand Avatar answered Nov 20 '22 09:11

Anand