mkvirtualenv: Too many levels of symbolic links
Asked Answered
B

8

32

I am running virtualenv burrito and getting an error that there are too many levels of symbolic links. I have no idea what that means.

mkvirtualenv --python /usr/local/bin/Python3 mantis

Error:

Running virtualenv with interpreter /usr/local/bin/Python3
Using base prefix '/Library/Frameworks/Python.framework/Versions/3.4'
New python executable in mantis/bin/Python3
Also creating executable in mantis/bin/python
Traceback (most recent call last):
  File "/Users/croberts/.venvburrito/lib/python2.7/site-packages/virtualenv.py", line 2352, in <module>
    main()
  File "/Users/croberts/.venvburrito/lib/python2.7/site-packages/virtualenv.py", line 825, in main
    symlink=options.symlink)
  File "/Users/croberts/.venvburrito/lib/python2.7/site-packages/virtualenv.py", line 985, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/Users/croberts/.venvburrito/lib/python2.7/site-packages/virtualenv.py", line 1439, in install_python
    raise e
  File "/Users/croberts/.venvburrito/lib/python2.7/site-packages/virtualenv.py", line 1431, in install_python
    stdout=subprocess.PIPE)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/subprocess.py", line 859, in __init__
    restore_signals, start_new_session)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/subprocess.py", line 1457, in _execute_child
    raise child_exception_type(errno_num, err_msg)
OSError: [Errno 62] Too many levels of symbolic links

I was getting this error before and solved it by doing Python3.4 instead of Python3. Now it won't work no matter which python I try to use. Even if I try to use the default (2.7)

Brighten answered 4/5, 2015 at 21:28 Comment(0)
B
6

The reason this wasn't working was because I was capitalizing Python. As soon as I did it using python3 instead of Python3 I stopped getting trouble.

Brighten answered 18/6, 2015 at 16:24 Comment(0)
B
40

Strangely, I ran into this when I tried to create a virtualenv with a name that already existed. Solution to remove the old and create a new one:

rmvirtualenv old-one
mkvirtualenv new-one
Bovid answered 15/6, 2015 at 22:42 Comment(0)
A
9

I had the same problem on OSX.

I got rid of it after:

1. removing env folder
2. removing __pycache__ folder
Albedo answered 7/11, 2016 at 11:49 Comment(3)
THanks! this finally saved me from this ordealHospitable
rm -rf ${virtualEnvName} was enough to fix this for my case.Doan
where are you doing this? I mean in which directory?Vociferation
B
6

The reason this wasn't working was because I was capitalizing Python. As soon as I did it using python3 instead of Python3 I stopped getting trouble.

Brighten answered 18/6, 2015 at 16:24 Comment(0)
I
6

I'm using a mac and I solved this by rm the virtual env that is named the same as you are trying to create. Specifically, I rm the folder within Users/user_name/.virtualenvs/. Then the create worked.

Iseult answered 12/2, 2019 at 17:12 Comment(1)
Thanks, I had same issue on Mac which I resolve with your solutionCaryophyllaceous
R
1

I'm not sure why but using

python3 -m venv venv

instead of

virtualenv -p python3 venv

and then activating the venv or setting the paths manually, something like this

      export PYTHONPATH=.:\$PYTHONPATH
      VIRTUAL_ENV=`pwd`/venv
      export VIRTUAL_ENV
      PATH="\$VIRTUAL_ENV/bin:\$PATH"
      export PATH

worked for me.

I tried to do some quick searching of the different between virtualenv and python3 -m venv module...but didn't find anything.

Redfin answered 15/1, 2020 at 19:42 Comment(0)
L
0

I came across it after I had built my freshest environment. Because it has been interrupted by myself while it was building the new one. Then I noticed that virtualenvwrapper already created a new environment folder underneath the environment directory but it has not been accomplished properly. Hence, I deleted the lastest environment folder and retried to install same environment. It fixed!

Lobelia answered 26/3, 2018 at 9:16 Comment(0)
E
0

I had the same problem in raspberry pi during open cv installation. I solve my problem by using below method.

Go to /home/pi ls -all and check weather .virtualenvs is there or not if it is there remove it by rm -r .virtualenvs

Erickaericksen answered 26/12, 2018 at 5:46 Comment(0)
A
-1

File "/Users/croberts/? seems you're using Windows. Consider using 'virtualenvwrapper-win'. The latest version is 1.2.0 which support python 2 up to 3.4. I've used it without any problems. If you use several versions of python on your computer, you can switch between them using 'pywin'.

For making new virtualenv:

C:\Users\your_directory>mkvirtualenv neo
Using base prefix 'C:\\Python34'
New python executable in neo\Scripts\python.exe
Installing setuptools, pip...done.

For view existing virtualenv:

C:\Users\your_directory>lsvirtualenv

dir /b /ad "C:\Users\your_directory"
=========================================================================
env0
env1
env2
neo
Adena answered 5/5, 2015 at 2:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.