简体   繁体   中英

Would it be dangerous to uninstall Python

I plan on uninstalling and reinstalling Python to fix pip. I, however, have a lot of python files which I worked hard on and I really don't want to lose them. Would my Python files be okay if I uninstalled Python?

If you are using Linux and a distribution like Ubuntu, you will definitely break the OS. Don't do it.

Moreover, there is no evidence that your installation is broken because of Python, and you may probably not solve your problem.

Your Python files are not specially managed by Python itself. If you uninstall Python, source code files (files with the .py extension) won't be affected.

There's no harm I can see in overwriting a pip installation. So, just follow the instructions and let us know if you have further problems:

  1. Download get-pip.py .
  2. Run python get-pip.py and get on with the rest of your stuff.

Before uninstalling python, make sure all your python applications support the new python version.

My suggestion is to create virtual environments in your system to use multiple python versions

Try Anaconda - https://www.anaconda.com/ to create multiple virtual environments, where you can run a python version on each environment.

It depends on whether you installed the Python or it came with the OS.

If you installed Python, it's no problem at all — your files are safe and uninstalling Python won't touch them.

If you're planning on uninstalling the Python that came with your OS, I'd advise not do do that — it could cause a whole lot of trouble. Instead, you could install a new version of Python into your user directory and link to it by adding its location to the PATH variable used by your shell.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM