python - 《Flask Web》一书中pythpn虚拟环境的作用
PHP中文网
PHP中文网 2017-04-18 10:03:18
0
4
404

我刚开始接触《Flask Web 》,已经创建了一个虚拟环境,出现了相应的文件夹,但是接下去一节内容好像没有提到虚拟环境相关知识。请问虚拟环境应该怎样使用,是要把接下来的代码都保存在虚拟环境和的文件夹里面吗? 怎样在虚拟环境中调出Python的IDLE?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(4)
阿神
  • virutalenv is used to isolate Python and Python installation packages.

  • When using virtualenv, you need to run the command in the command line: env/bin/activate

  • IDLE is a Python IDE, and the Python interpreter used is the system default.

You can use a convenient editor to edit Python code, such as PyCharm in Windows, etc., and then use virtualenv on the command line to run the code.
You can also specify a virtualenv in Pycharm to run: http://blog.csdn.net/hy245120...

PHPzhong

You must not have read the book carefully. The book clearly explains how to use it:

Now, there is a subfolder named venv in the flasky folder, which saves a new virtual environment with a private Python interpreter in it. Before using this virtual environment, you need to "activate" it. If
you use the bash command line (Linux and Mac OS Is:
$ venvScriptsactivate
$ source venv/bin/activate
如果使用微软Windows 系统,激活命令是:
$ venvScriptsactivate

伊谢尔伦

To be honest, I hate using this virtual environment. It is not a particularly ideal solution. It is recommended not to invest too much time. I have been studying docker recently.

刘奇

You can also use $ source venv/bin/activate 进入虚拟环境, 之后就像普通方式使用 python, pip 等.
使用结束后可以使用 $ deactivate to exit the virtual environment.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!