Unable to solve the error after installing virtualenv

My computer system is mac OS ventura 13.4. After I install virtualenv and virtualenvwrapper using pip3, a large error message pops up every time I open the terminal
enter image description here

Can you please help me to see how to solve this problem

>Solution :

As it happens when you open the terminal, then it means stuff added to .bashrc (or whatever your shell’s config) or .profile is messed up and contains (directly or via source) some call to virtualenv --version# (with the #, yes, the error says so).

So first thing would be to check those two files and find whether any of them calls that directly. And if yes, just remove that line – save, source or open new console and see if the help (with error) pops up again or not.

[Note: Installation itself shouldn’t have made you edit virtualenvwrapper.sh itself, but if you did open it and modified it, even accidentally, please do tell. That would mean the breaking line could be there. See below – [1].]

Then walk through virtualenvwrapper’s installation steps again to see whether your .bashrc/.profile/whatever shell you’re using config is correct – https://virtualenvwrapper.readthedocs.io/en/latest/install.html#basic-installation

If you don’t have that call directly, you’d want to inspect all source calls in those files.

Is there anything suspicious like call to your own file? If yes, first check that file.

[1] Virtualenvwrapper’s installation itself should’ve made you add source with path to virtualenvwrapper.sh. There shouldn’t have been any modifications to that file on your part. Please just make sure the file is the same as https://github.com/python-virtualenvwrapper/virtualenvwrapper/blob/main/virtualenvwrapper.sh – no added lines, no missing lines etc.

Leave a Reply