PYTHONP network programming new version Pycharm automatically set up a virtual development environment

Python is an open source software, supports many third-party packages , also called modules , can be understood as software. Third-party development package to support different scenarios , different development projects of times may require different software packages .

 

If you develop in the same environment , which is developed in the system environment ( on a python software home directory installation ) , all projects of the packages will be installed in the same directory , this will make a lot of directory program, the space occupied great . Usually at the time of publication production environment projects, project procedures depend on the packages also need packaged and released, it will make the program very large. So the need for a different project to establish an independent development environment , install a different project program depends package . This is the virtual development environment. 

 

Virtual previously installed development environment is the use of this software is installed :

PIP virtualenv the install warpper-win ------- installation virtualenv program,  

then the computer to modify the system in workon the path , the equivalent of a virtual environment created by the master directory , by default in the current user directory,

Use MK Virtual env venv_1 create a virtual environment Venv _1 ,

Use workon Venv _1 , enter the virtual environment,

Use PIP install django , install django development package,

installation After completion, you can use PIP List view the current virtual software packages installed in your environment,

Use deactivate , exit the current virtual development environment,

Then enter pycharm associated with the virtual development environment project ,

start development projects

 

You can see the whole process is very tedious , but the new version of pycharm simplify these operations are very simple , in 2019.3.3 of pycharm later version installed, we begin to create a project:

 

Create a project

1.png


2.png


Note : Create a project name must not contain Chinese characters, if you include Chinese characters and automatically create virtual environments using up a lot of trouble

 

Create a new python file

3.png


Then you look to the left of the project location has a venv folder , at the same time open the project in the computer catalog can also be seen in this folder

4.png

4.1.png


This explanation pycharm creating a project , the automatically created virtual items associated with the development environment, and the setting has been associated in good

点开下方terminal,可以看到现在正在虚拟开发环境内


5.png

输入pip –V查看当前虚拟开发环境


6.png

输入pip install --trusted-host https://pypi.douban.com/simple/ django从豆瓣安装django


7.png

   安装完毕,使用pip list查看虚拟开发环境中安装的软件包


8.png

这时可以打开cmd,查看系统目录和目录下安装的软件包


9.png

10.png


可以看到系统目录下,并没有安装django


注意:创建的项目一定不能包含汉字,否则默认安装软件包的目录会在系统目录下 

整个操作流程很简洁,不需要使用virtualenv来创建虚拟环境非常棒

We recommend that you use genuine PyCharm , Official Download: https://www.jetbrains.com/pycharm/


    Python Network Programming is to use software-defined network technology, the new version of Cisco EI CCIE exam will also outline the Python programming as test sites. A new generation of network hardware and software skills of both workers faced with the demand. Net working for programming to gradually pay attention to it. For the recent on-line network programming course work, more continuously updated


Guess you like

Origin blog.51cto.com/11042505/2477118