Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtualenv venv OSError: [Errno 95] Operation not supported #173

Open
gagarin42 opened this issue Mar 23, 2018 · 5 comments
Open

virtualenv venv OSError: [Errno 95] Operation not supported #173

gagarin42 opened this issue Mar 23, 2018 · 5 comments

Comments

@gagarin42
Copy link

After following the install instructions virtualenv venv on Ubuntu 16.04.4 leading to this issue:

"Running virtualenv with interpreter /usr/bin/python2
New python executable in /mnt/hgfs/VM_share/combine/venv/bin/python2
Also creating executable in /mnt/hgfs/VM_share/combine/venv/bin/python
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/virtualenv.py", line 2363, in <module>
    main()
  File "/usr/lib/python3/dist-packages/virtualenv.py", line 719, in main
    symlink=options.symlink)
  File "/usr/lib/python3/dist-packages/virtualenv.py", line 942, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/usr/lib/python3/dist-packages/virtualenv.py", line 1400, in install_python
    os.symlink(py_executable_base, full_pth)
OSError: [Errno 95] Operation not supported"

Problems of Python 2 and 3? Any help is greatly appreciated.

@decidedlygray
Copy link

Here is my guess: your Ubuntu 16.04.4 is running in a VM. You are trying to set up the virtualenv into a shared folder. That shared folder is shared with a Windows VM, and the filesystem of that share does not support symlinks.

The fix would be: create your virtualenv within Ubuntu 16.04.4 not in /mnt/hgfs/VM_share, but somewhere else on the / filesystem (like /opt/ or ~/).

@johnsodd
Copy link

johnsodd commented Jul 9, 2018

@decidedlygray Oddly I have a very similar issue. I have mounted a myCloud drive to an Ubuntu 16.04 vm. This VM is actually sitting on top of a macOS (ie..host machine). The macOS is not sharing or accessing this mount point. I get the same error when I try to repo init on this mount. This is a 4TB cloud drive that I'd love to develop on. Thoughts?

@decidedlygray
Copy link

@johnsodd If it is that exact same error message, my first thought would be - the myCloud, for compatibility, probably came formatted as FAT or NTFS, neither of which support symlinks. Disk Utility on your mac, or the lsblk -f command in Ubuntu should be able to tell you the filesystem of the drive.

I would suggest taking everything you want to keep off of the myCloud drive, and reformatting it as ext4. If you also want macOS to read/write to the drive, there are some compatibility issues to consider first though. As far as I remember, macOS cannot read ext4 without additional software installed. So if you are going to want your mac to be able to use the drive, you'll want to do one of the following:

  1. Format the drive as HFS+, then install sudo apt install hfsprogs in Ubuntu so it can read/write to the HFS+ drive. I think the symlinks should work fine, but you'll want to test that. This link should help with the HFS+ reformat using the mac, it's old, but I don't think Disk Utility has changed much - http://osxdaily.com/2012/01/04/format-an-external-hard-drive-or-usb-flash-drive-for-mac-os-x/ and this link should help with the hfsprogs install in Ubuntu and mounting the drive: https://askubuntu.com/questions/332315/how-to-read-and-write-hfs-journaled-external-hdd-in-ubuntu-without-access-to-os
  2. Format the drive as ext4, then on your mac install something like extFS (cost is $40). There is also a FOSS package here that has similar capabilities. If you want to go the FOSS route, you'll want to install the latest release from that link, then look into installing the Ext package, details here

Dealer's choice on which way you want to go. Personally, I'd probably opt for option 1 personally because it's less complicated to set up, assuming symlinks work as expected.

@alphacodinghub
Copy link

To use pipenv to manage Python virtual environments, which is also recommended by Python officially. Pipenv stores environmental files in user's home folder. This avoids the file system problems with shared folders.

@KirpaD
Copy link

KirpaD commented Sep 23, 2022

I created myproject folder manually in my HOME then ran sudo python3 -m venv myproject to create virtual env successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants