Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to deploy the Python development environment

Shulou Source: shulou.com Published: 2022-06-01 04:09:00 09月26日 Update

Today, the editor will share with you the relevant knowledge points about how to deploy the Python development environment. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

An overview of the development environment

Windows7

Python3.7 installation directory D:\ Program Files\ python37

IDE Pycharm

Wamp 3.0.6 64bit supports PHP development

VC MSVC11 (Visual C++ 2012)

Second, find Web support

First of all, necessary improvements have been made to the local python, supporting the pip installation package, using pip install setuptools and installing commonly used modules, toolkits

I hope to be able to build a web development environment that supports Python3.7 in the Wamp environment.

2.1 solution

The mod_wsgi expansion module of the Apache HTTP server implements the Python WSGI standard and can support any Python application compatible with the Python WSGI standard.

2.2 how to load the mod-wsgi extension

First install the components on the following website

Https://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi

LoadModule wsgi_module modules/mod_wsgi.so

Tell apache what path the request is based on and pass it to wsgi for processing

First install the component mod_wsgi.so on the following website

Https://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi

LoadModule wsgi_module modules/mod_wsgi.so

The purpose is to tell apache what path the request is based on to be forwarded to wsgi for processing

The operation is not successful. It may be due to version dependency consistency.

Three changes of thinking

Most of the functions of Python are based on scripts, and the support for Web server can be temporarily reduced without developing the entire website project, so the construction of python web server under wamp is not considered for the time being.

4. Use Pycharm

By creating a project, it is found that Pycharm automatically adds a virtual environment to the project you create.

4.1 Virtual environment

Virtualenv is a tool that can isolate multiple versions of python on the same computer. Let's start with the following questions

Installed successfully with pip install pymongo, but the module python was not found when used in the code

Pycharm: File > Settings > Project "own Project" > Project InterPreter

You should see a list of installed libraries that you often use. It can only be used in the code if it is shown here, otherwise the error of the module will not be reported.

Reason:

Pycharm creates the properties of the project created by chram the Interpreter path is a virtual python execution environment

This environment is optional.

4.2 Python interpreter

Through the selection of virtual environment in the process of building a new environment, a conceptual Python interpreter is introduced.

Python is an interpreter language. If the code wants to run, it must be executed through the interpreter. The above configuration of the virtual environment is actually the designated compiler.

These are all the contents of the article "how to deploy the Python Development Environment". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Tags: Environment development support modules knowledge articles interpreters interpreters code servers websites paths projects services success content reasons most of which are tools Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MySQL Shulou Technology Shulou Tech Info MariaDB