How to check python installation path
The computer system used by each user may be different, and there will also be different versions of python installed. The way to view the python installation path will be different depending on the version.
The following is introduced using two different environments, Linux and Windows.
Linux
For the linux platform It is said that many running system software are based on python. If python makes an error, the entire system may be at risk of major problems. Let's take CentOS 7 as an example. In CentOS7, the basic version of python is 2.7, as shown in the figure below.
After the python command can be executed correctly, we first find the location of the python command. The command to find python is:
whereis python
The result is as shown below. You can see that the path is /usr/bin/python
Related recommendations: "python video tutorial"
Then we use this command to find out which installation package it is. The command is:
rpm -qf /usr/bin/python
The result is as shown in the figure below, you can see Go, the installation package is python-2.7.5
Then we can find the installation path of all its files according to the python installation package, and query all the files of the installation package The path command is:
rpm -ql python-2.7.5
As shown in the figure below, you can see that all python command paths are displayed.
But the above results do not show the location of all python library files, and you still need to find them. In Linux, the package name of the library file is generally the program name - libs. If we want to search for python here, the corresponding package name is python-libs. We use the rpm -qa command to query the following, and we can see that this package does exist. As shown in the figure below:
After finding this package, execute the same query command
rpm -ql python-libs
The corresponding results will all come out, as shown in the second picture below:
If you have a lot of third-party library files installed If so, the query results will be very long. Press the space bar to turn the page and scroll all the way to the bottom to see the location of the python-libs help file, as shown in the picture below. At this point, the installation paths of all python files on Linux have been found
Windows
windows platform If python has been installed If so, open the command line window, enter the python command and press Enter to enter the python command line interface. As shown in the picture below:
What we can be sure of at this time is that the installation path of python must have been added to the windows environment variables, because only when added to environment variables before it can be executed from the command line. Therefore, we only need to open the environment variable path to find the installation path of python. First, right-click on the computer icon on the desktop and select Properties.
Then click Advanced System Settings on the right side of the Computer Properties page, as shown in the picture below:
Advanced You can see the environment variables under the system settings. After clicking it, find the PATH variable in the user variables, and then click the edit button in the lower right corner.
In the opened PATH variable, we can clearly see the installation path of python, as shown in the figure below:
Then we open the corresponding folder according to the python path value in the PATH variable. As shown in the figure below, all python installation files are inside.
The above is the detailed content of How to check python installation path. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

Running Python code in Notepad requires the Python executable and NppExec plug-in to be installed. After installing Python and adding PATH to it, configure the command "python" and the parameter "{CURRENT_DIRECTORY}{FILE_NAME}" in the NppExec plug-in to run Python code in Notepad through the shortcut key "F6".

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

Golang and Python each have their own advantages: Golang is suitable for high performance and concurrent programming, while Python is suitable for data science and web development. Golang is known for its concurrency model and efficient performance, while Python is known for its concise syntax and rich library ecosystem.

Python is easier to learn and use, while C is more powerful but complex. 1. Python syntax is concise and suitable for beginners. Dynamic typing and automatic memory management make it easy to use, but may cause runtime errors. 2.C provides low-level control and advanced features, suitable for high-performance applications, but has a high learning threshold and requires manual memory and type safety management.
