In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
In this issue, the editor will bring you the relevant configuration of the Python interpreter. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
1. Preparatory work
(1) the Pycharm version is 3.4 or higher.
(2) at least one Python interpreter has been installed on the computer.
(3) if you want to configure a remote interpreter, you need the relevant support of the server.
2. Local interpreter configuration
The steps to configure the local interpreter are relatively simple and straightforward:
(1) Click the Settings button in the toolbar.
(2) Select the Project Interpreter page in the Settings/Preferences dialog box, select the corresponding interpreter version in the drop-down list corresponding to Project Interpreter, or click the settings button on the right to add it manually.
(3) in the next case, select the Add Local option, and then select the expected interpreter (the executable of Python).
It is worth mentioning that for some predefined virtual environments, they can also be added as interpreters.
3. Remote interpreter configuration
When configuring the remote interpreter, use the setup method based on the SSH connection (ensure that the server has provided remote support for the response).
4. Configure the remote interpreter through the existing deployment settings
First, we need a server, which can be defined through the Tools | Deployment of the main menu, and then click Configuration:
Next, click the green plus sign in the Deployment dialog box to create a server, enter a name, select the corresponding type (usually SFTP), and other necessary settings (host, port, login name, etc.). Click Test connection after confirmation and pop up Connection successful! Indicates that the interpreter is connected successfully
Next, click the settings button in the main toolbar, open the Project Interpreter page in the Settings/Preferences dialog box, click the settings icon, and select Add Remote:
In the Configure Remote Python Interpreter dialog box, click the Deployment configuration button to set up the existing SSH server (such as the one you defined earlier).
Select the desired remote service in the list, and you will find that all server settings have been automatically populated.
At this point, the remote interpreter can be used as the interpreter for the current project. Note that all remote interpreters are named with a prefix "Remote".
5. Remote interpreter based on SSH certificate
If you do not define the server settings in advance, you can also manually establish a specific connection by following these steps:
1. Click the settings button on the main toolbar to open the Settings/Preferences dialog box, select the Project Interpreter page, click the settings button, and then select Add Remote:
Next, in the Configure Remote Python Interpreter dialog box, select SSH credentials, and then type the server's Host, port number, user name, and so on:
At this point, the remote interpreter can be used as the interpreter for the current project. Note that all remote interpreters are named with a prefix "Remote".
6. Remote interpreter based on virtual box
Another way to define a remote interpreter is through the Vagrant configuration file. Prepare some work in advance before using virtual boxes, so confirm a few issues before you start:
(1) Vagrant has been installed correctly on the computer and the relevant infrastructure has been created.
(2) Oracle's VirtualBox has been installed correctly on the computer.
(3) be sure to add the paths of the following two executables to the environment variables of the system:
The vagrant.bat file in the Vagrant installation directory, which should be done automatically by the installer.
The path to the VBoxManage.exe file under the Oracle's VirtualBox installation directory.
Finally, make sure that the relevant plug-ins for Vagrant can be used properly.
First of all, you need a virtual box, which requires us to configure it manually, but Pycharm provides a series of aids to yes we can complete the setup in the current IDE environment.
Click the Settings button in the main toolbar to enter the Settings/Preferences dialog box and open the Vagrant page.
Notice the path to the Vagrant executable file and the folder path where the Vagrant instance is located:
If the virtual box is defined by the implementation, it will appear in the drop-down list to facilitate our selection. If you don't currently have an appropriate virtual box to choose from, you can create a new one by clicking the green plus sign.
Next, you need to initialize the Vagrant box. Click Tools | Vagrant on the main menu, select Init in Project Root, and select the vagrant up command:
Next, go to the Settings/Preferences dialog again, open the Project Interpreter page, and select Add Remote:
Customize the server's settings in the Configure Remote Python Interpreter dialog box, which can be replaced by the previously defined configuration file, so select the Vagrant option.
All server settings are automatically populated as follows:
At this point, the remote interpreter can be used as the interpreter for the current project. Note that all remote interpreters are named with a prefix "Remote".
See dedicated Vagrant tutorial for more information.
7. Create a virtual environment
(1) Open the Project Interpreter page (by clicking the settings button on the toolbar).
(2) Click the settings icon and select Create Virtual Environment.
(3) enter the name and location of the new virtual environment in the Create Virtual Environment dialog box, and work out the Python interpreter that the virtual environment depends on:
It may take some time to create a virtual environment, and Pycharm gives a progress bar to indicate the current creation process:
8. Configuration of third-party libraries and paths
After configuring the virtual environment, you will see all the currently installed third-party libraries. Pycharm will list the version of each currently installed third-party library and the latest version of the response, and you can decide whether to upgrade it or not:
To view the installation path, you can select More by clicking the Settings button in the dialog box, where you can view all available Python interpreters:
Select an interpreter and click the button in the right toolbar to view its corresponding path structure:
If an interpreter has been updated, it is best to update its path by clicking.
The above is the relevant configuration of the Python interpreter shared by the editor. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.