I am trying to create a virtualenv on my external hard drive that I use for both my Ubuntu and my Windows installation (I have a SSD and use 2TB external hard drive for anything but PC games).
When I navigate to the place and try to create it with the commands that work on the standard Ubuntu home drive, I get the following:
nebelhom@nebelhom-desktop:/media/extHDD/virt_folder$ virtualenv MyFolder
New python executable in /media/nebelhom/extHDD/virt_folder/MyFolder/bin/python
ERROR: The executable /media/nebelhom/extHDD/virt_folder/MyFolder/bin/python could not be run: [Errno 13] Permission denied
Running the same with "sudo" did not help either and gave the same error as above.
What I tried next is indicating the python version
nebelhom@nebelhom-desktop:/media/nebelhom/extHDD/virt_folder$ sudo virtualenv -p python2.7 MyFolder
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in /media/nebelhom/extHDD/virt_folder/MyFolder/bin/python2.7
Not overwriting existing python script /media/nebelhom/extHDD/virt_folder/MyFolder/bin/python (you must use /media/nebelhom/extHDD/virt_folder/MyFolder/bin/python2.7)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 2332, in <module>
main()
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 711, in main
symlink=options.symlink)
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 924, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 1369, in install_python
os.symlink(py_executable_base, full_pth)
OSError: [Errno 17] File exists
And now I am stuck :/ . Has anyone of you tried something like this before and succeeded? I am really out of ideas here...
I tried to search for a solution previously, but for this particular problem I did not find anything useful. I will carry on looking and post any link that I can find that might be remotely related.
Thanks in advance for any help you can offer. It is much appreciated.
I think its happening because of filesystem on your external HDD. From your question I can guess that you use your external hard disk with both windows and linux, and its file system might be NTFS.
File permissions don't exist on NTFS and all the usual linux things like chown and chmod, that can be the reason why you are having these problems.
I would suggest, that you try to create a new partition on your ext HDD using a linux based filesystem like ext4. Then try to create a virtual environment.
I have tried creating python virtual environment on a removable disk, worked like a charm, only the FS was ext4.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With