Using virtualenv in VMWare with a Windows shared folder

I am currently using a Linux virtual machine in VMWare running on a Windows machine. I have a Windows shared folder for my projects that I access on linux via / mnt / hgfs /

When I try to use virtualenv for my python projects, I get the error "Operation not supported":

joe@myserver :/mnt/hgfs/winwww/envtest# virtualenv env Traceback (most recent call last): File "/usr/local/bin/virtualenv", line 9, in <module> load_entry_point('virtualenv==1.7', 'console_scripts', 'virtualenv')() File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 928, in main never_download=options.never_download) File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 1029, in create_environment site_packages=site_packages, clear=clear)) File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 1164, in install_python copyfile(join(stdlib_dir, fn), join(lib_dir, fn)) File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 430, in copyfile copyfileordir(src, dest) File "/usr/local/lib/python2.6/dist-packages/virtualenv.py", line 405, in copyfileordir shutil.copytree(src, dest, True) File "/usr/lib/python2.6/shutil.py", line 173, in copytree raise Error, errors shutil.Error: [('/usr/lib/python2.6/config/libpython2.6.so', 'env/lib/python2.6/config/libpython2.6.so', '[Errno 95] Operation not supported')] 

I suppose this is because Windows cannot handle symbolic links, because I can create my virtual names in other directories.

Has anyone developed a way to get virtualenv to work in Windows public folders? I am editing my code on my Windows machine, so I use shared folders.

Thanks.

+4
source share
1 answer

Virtualenv does not need to be placed next to your code, so even if you cannot create it in your shared folder, this should not affect your ability to edit code on windows and run it on your host platform. It sounds like a bad idea to me, anyway, to try and share platform-specific files with multiple platforms.

This is the usefulness of .pth files, and if you use setuptools with setup.py in your project, you can simply $VENV/python setup.py develop , which will link your project with a virtual file, wherever it is. Then you can run $VENV/python and your package will be in sys.path and available for import.

+5
source

Source: https://habr.com/ru/post/1389050/


All Articles