How can one uninstall virtualenvwrapper? - python

I believe that I have installed virtualenvwrapper incorrectly (the perils of following different tutorials for python setup).
I would like to remove the extension completely from my Mac OSX system but there seems to be no documentation on how to do this.
Does anyone know how to completely reverse the installation? Its wreaking havoc with my attempts to compile python scripts.

pip uninstall virtualenvwrapper
Or
sudo pip uninstall virtualenvwrapper
worked for me.

On windows - This works great
pip uninstall virtualenvwrapper-win

Related

No module named pip on macOS Big Sur

I'm running macOS 11.2.2 Big Sur and I'm trying to get pip to work with the latest Python 3.9.4. This turned out to be ridiculously difficult even though I've read a number of articles on the subject. Possibly, it is the debris I accumulated in the system over the years which is causing me trouble. I need advice as to how to get things right again.
Checklist:
/usr/local/opt/python/bin/python3 --version is Python 3.9.4 installed from brew in the most usual way; it's a symlink to ../Frameworks/Python.framework/Versions/3.9/bin/python3, which is in Cellar.
Both python and python3 commands are aliased to /usr/local/opt/python/bin/python3, they give the correct version.
I used both get-pip.py and ensurepip, and both of them say everything is fine: "Successfully installed pip-21.1.1 setuptools-56.0.0"
The only thing in env that has anything to do with Python is this part of PATH: /usr/local/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/bin. The lack of this one is reported as warning when you install pip.
Still, I get this:
python -m pip --version
/usr/local/opt/python#3.9/bin/python3.9: No module named pip
What am I missing? 🤯
I also found this article that instructs to use pyenv, but running it on the latest macOS is yet another problem: pyenv install 3.9.4 doesn't build for some reason.
Using pointers from #gold_cy in the comments I was able to resolve the problem by running get-pip.py with an additional parameter: --prefix=/usr/local/.
While the official pip installation guide does mention that there may be problems on the systems like macOS that manage their own Python install, it doesn't say directly what you can do about it. Which is a shame, because the phrasing in PyPA » Python Packaging User Guide » Tutorials » Installing Packages is exactly the same, only the last phrase is missing from pip's page:
Warning Be cautious if you’re using a Python install that’s managed by your
operating system or another package manager. get-pip.py does not coordinate
with those tools, and may leave your system in an inconsistent state. You can
use python get-pip.py --prefix=/usr/local/ to install in /usr/local which is
designed for locally-installed software.
I was trying to resolve the problem for python3 in MacOS. The accepted answer didn't help me.
What helped me is complete reinstall of the python3:
brew uninstall python3 # if python3 worked before
brew install python3

Problems installing the right version of Python

Has anyone had this problem: when trying to install python>=3.6.6 by typing sudo apt-get install python>=3.6.6, to get another version? I get 3.5.3 and I do not understand why it happens so.
Could anyone help?
Thanks!
The version of python installed through apt is determined by the configuration in /etc/apt/sources.list. You can modified it to add additional sources but it is not recommended to do so since it may cause unexpected problems. A more safe way is to use anaconda or miniconda to manage your python environment. You can install any version of python through conda. Refer to this tutorial.

Accidentally installed python 3.5 vs. python3.5 : Is this bad?

I run Linux Mint with Python 3.4.x pre-installed. I'm starting a new project and wanted to take advantage of 3.5ish stuff so I decided I would install 3.5 and create my new virtual environment pointing to it.
So, I by accident typed
sudo apt-get install python 3.5
Which I've since learned is different from
sudo apt-get install python3.5.
I know that is different because the later requires adding a new repository wherein the former I was able to do before I added the deadsnakes repo.
So, I went through the install of "python 3.5" - it asked me some questions about FTP to ined(something) or standalone, then I installed python3.5.
My question(s) is
1) What is python 3.5? (with the space),
2) Did I break anything,
3) Should I uninstall python 3.5 even though the uninstall warns me not to unless I really know what I am doing?
Thank you
Newer versions always have newer patches and fixes. Python 3.5.2 is probably what you installed if you used sudo apt-get install python3.5. There is also Python 3.6 now.
With the space (sudo apt-get install python 3.5) it would mean install python and 3.5 so maybe it just installed/updated python2.
Anyway, having multiple versions is not an issue. You may alias each install and use them as required.
Should I uninstall python 3.5 even though the uninstall warns me not to unless I really know what I am doing?
You shall do that if no other program/dependency is lost. Have you used it in some code? (which wouldn't work if its gone!) If you haven't then go ahead uninstall it.
It's not good. I had the same installing Ruby and accidentally typing:
Don't do this!!
apt install ruby 2.4
It installed the latest Ruby and many gigabytes of packages with 2.4 in the name.
I tried to remove them with
apt remove 2.4
...but it turns out some of these packages are essential for the Operating System.
To list the packages with label 2.4:
apt-cache show 2.4
So uninstalling non-essential packages could be an option if you manage to list them and use that output as arguments for apt remove. But I suppose even then your system may potentially be left unstable.
Luckily I ran the command on a relatively fresh Raspbian install so I'll just do a clean install. Apt install is a surprisingly dangerous command, :D, good luck

Is it dangerous if I uninstall all the packages in `pip list` on MacOS?

The python I use is the one of MacOS. It seems that the python of the system did not carry pip, and pip is installed by myself.
It's very annoying to use the python of the system, there is always the "Permission denied" issue and I'm tired of this. So, I want to uninstall all the packages by pip firstly, and then use virtualenv. Before that, I'd like to know
Is it dangerous if I uninstall all the packages in pip list on MacOS?
Edit: Currently, there are both Python 2.6 and 2.7 on my mac in the directory: /Library/Python. Then can I remove python 2.7 totally and reinstall it in another way?
Do not uninstall MacOS python packages. I did that once. Wasn't a fun time. Even installing new packages can lead to huge problems as dependencies get updated and no longer work with OSX stuff, particularly stuff you can't even update because of SIP.
If you make a virtualenv, it will be totally separate from the OSX python. You can use pip in the virtualenv and it will not effect the pip outside of the virtualenv. In otherwords, you don't need to remove anything - just make the virtualenv and start pip insall'ing :)
I ended up installing Anaconda Python from Continuum Analytics and then setting my path to that python. This way I got an updated python to work with (plus a bunch of other advantages) but my Mac could keep Python 2.6 it needs to operate properly.

How to install pip in a new python installation

I recently installed python 2.7.2 on my Mac running OSX 10.6.8. Previously, I had version 2.6. I set my path in .bash_profile as follows:
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/share/python:$PATH
so that when I run python it will refer to my new installation. It does.
I would also like to use pip with my new installation, but the problem is that I already have the current version of pip installed at
/usr/local/bin/pip.
I tried to re-install pip with:
easy_install pip
But, of course this does not put pip in the desired new directory
/usr/local/share/python/pip
but simply refers to the existing version in /usr/local/bin/pip.
Can someone tell me how to fix this?
I would like to then use pip to install NumPy and SciPy in the correct directory (I was having trouble getting the SciPy installation to work with my old version of python, hence the new install).
If you'd like, you can visit the website where I found instructions for installing python 2.7, creating/updating my .bash_profile, installing pip, and NumPy and SciPy. Might provide some insight, or I'm happy to give more details if needed. Thanks!
http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/#python
Install distribute as per the instructions at http://pypi.python.org/pypi/distribute .
Make sure you specify the full path to the python executable (/usr/local/share/python/python or smth in your case).
$ curl -O https://svn.apache.org/repos/asf/oodt/tools/oodtsite.publisher/trunk/distribute_setup.py
$ /usr/local/share/python/python distribute_setup.py
Then you should have /usr/local/share/python/easy_install.
After that, run:
$ /usr/local/share/python/easy_install pip
Then you should have /usr/local/share/python/pip.
Depending on the ordering of things in your PATH, either your old, or the newly installed pip is executed when you execute the pip command, so you either might have to adapt your PATH, or specify the full path to /usr/local/share/python/pip when installing eggs.
(shameless plug:
In any case, you might consider using virtualenv for installing packages into a "project" specific isolated environment, as opposed to installing them globally.)
I needed to uninstall brew's python.
Then, I was left with python v2.7.6
Next to install, pip I ran
sudo easy_install pip
installed fine and working
I had a similar issue, try this:
$ python -m pip install --upgrade --force-reinstall pip
This will force reinstall pip with whatever version of python you use including installing the binary.
A few days ago I had a friend who was starting Python Programming and needed help with the same issue: installing pip. There are debates over which one to choose between easy_install and pip and it seems everybody is heading the pip direction. Either way, installing either of them can be frustrating.
You can use this simple tutorial : installing pip package manager the easy way
Here are what you should keep in mind as you follow the above guide:
If you already have an older version installed, uninstall it or totally remove the python installation
Once that is cleared, download an install Python.
After that, download ez_setup.py file and save it to your desktop - easily accessible from the command line
Now run it from the command line and it will install easy_install for you after which,
You can use it to install pip.
Once again, you can do this or use the above link to find a simple step-by-step guide on how to get it installed on your computer.
Good luck.
Just so that people knew, ATM we can install PIP by downloading get-pip.py from the page with docs and run it like this:
c:\python27\python.exe get-pip.py
BTW, Python 3.4 comes with PIP pre-installed.
One of the command line options lets you choose where to install to.
--install-dir (-d) install package to DIR
So something like - # easy_install pip -d /usr/local/share/python
(Please correct me if I'm wrong.)
Just wanted to say that I found a way to get around my problem. I don't know that I can explain it perfectly, since I am not very good at understanding what I am doing with this stuff just yet! But, the problem seems to have been with my PATH. I removed the PATH that I posted in my original question, and then used easy_install pip. It went straight to python 2.7.2 (my new version) with no problem. I then successfully used pip to install NumPy and SciPy in the correct location, and they both work. Thanks to ErikAllik and FakeRainBrigand for taking the time to look into it!

Categories