When I try running virtualenv I get the following error:
[jelly@laptop Getskilled]$ virtualenv venv
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 6, in <module>
from virtualenv import main
ImportError: cannot import name 'main' from 'virtualenv' (/home/jelly/.local/lib/python3.8/site-packages/virtualenv/__init__.py)
Virtualenv was working when I last used it for a project so I am guessing that an update cause it to break. I have tried reinstalling virtualenv and pip.
The closest post I could find was this one: virtualenv: cannot import name 'main'
I tried following this post so I ran the following in the python interpreter:
import virtualenv
virtualenv.__file__
Which returned: '/home/jelly/.local/lib/python3.8/site-packages/virtualenv/init.py'
However, there was no file /usr/local/bin/virtualenv.py and there is no virtualenv.py in the .local directory so that solution in that post won't work for me.
What can I try next?
Update: I found virtualenv.py in /usr/bin/ and it seems like it is causing the problem but I'm not sure how to update it to work with the current version. I moved it then tried reinstalling virtualenv but that did not generate a new virtualenv.py so still not sure what's going on.