当前位置: 首页 > news >正文

宁波公司网站建设定制服务/广告推广赚钱

宁波公司网站建设定制服务,广告推广赚钱,建设一个导航网站,卢湾网站设计有人说:virtualenv、fabric 和 pip 是 pythoneer 的三大神器。 不管认不认同,至少要先认识一下,pip现在倒是经常用到,virtualenv第一次听说,不过,总得尝试一下吧。 virtualenv 可以将环境和系统环境隔离开&…

 

有人说:virtualenv、fabric 和 pip 是 pythoneer 的三大神器。

不管认不认同,至少要先认识一下,pip现在倒是经常用到,virtualenv第一次听说,不过,总得尝试一下吧。

 virtualenv 可以将环境和系统环境隔离开,降低耦合

一、安装

pip install virtualenv

因为我已经安装了pip,那么就直接用pip来安装了,简单方便。

其它的安装方式请参考官方网站:http://www.virtualenv.org/en/latest/index.html

二、创建虚拟环境

root@kali:/recall/code# virtualenv test_env
New python executable in test_env/bin/python
Installing setuptools, pip...done.
root@kali:/recall/code# 

很简单,就是virtualenv 环境名称[自定义的名称,自己喜欢什么就写什么]

默认情况下,虚拟环境会依赖系统环境中的site packages,就是说系统中已经安装好的第三方package也会安装在虚拟环境中,

如果不想依赖这些package,那么可以加上参数 

--no-site-packages 

建立虚拟环境

即变成了:

root@kali:/recall/code# virtualenv test_env --no-site-packages
New python executable in test_env/bin/python
Installing setuptools, pip...done.
root@kali:/recall/code# 

三、启动虚拟环境

创建成功后,会在当前目录下生成对应的目录文件。

复制代码
root@kali:/recall/code# ls -l test_env/
总用量 16
drwxr-xr-x 2 root root 4096  4月 29 20:03 bin
drwxr-xr-x 2 root root 4096  4月 29 19:58 include
drwxr-xr-x 3 root root 4096  4月 29 19:58 lib
drwxr-xr-x 2 root root 4096  4月 29 19:58 local
root@kali:/recall/code# 
复制代码

我们先进入到该目录下:

cd test_env/

然后启动

root@kali:/recall/code/test_env# source ./bin/activate

启动成功后,会在前面多出 test_env 字样,如下所示

(test_env)root@kali:/recall/code/test_env# 

四、使用测试

复制代码
(test_env)root@kali:/recall/code/test_env# pip install requests
Downloading/unpacking requestsDownloading requests-2.2.1-py2.py3-none-any.whl (625kB): 625kB downloaded
Installing collected packages: requests
Successfully installed requests
Cleaning up...
(test_env)root@kali:/recall/code/test_env# python
Python 2.7.3 (default, Jan  2 2013, 13:56:14) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> 
>>> response = requests.get("http://www.baidu.com")
>>> response.status_code
200
>>> 
复制代码

五、退出虚拟环境

deactivate

完整如下:

复制代码
(test_env)root@kali:/recall/code/test_env# python
Python 2.7.3 (default, Jan  2 2013, 13:56:14) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> 
>>> response = requests.get("http://www.baidu.com")
>>> response.status_code
200
>>> exit()
(test_env)root@kali:/recall/code/test_env# deactivate
root@kali:/recall/code/test_env# 
复制代码

转载于:https://www.cnblogs.com/zsr0401/p/6382439.html

http://www.jmfq.cn/news/4740013.html

相关文章:

  • phpcms 多语言网站/青岛网站seo分析
  • wordpress 优化版/如何做好关键词的优化
  • 网站信息内容建设管理/seo排名软件怎么做
  • 印度电商平台网站建设策划/新冠疫情最新消息
  • 外贸网站建设推广公司价格/怎么样引流顾客到店方法
  • 怎么做旅店网站/市场调研报告1500字
  • 云服务器可以做视频网站吗/长沙靠谱seo优化价格
  • 国务院 门户网站建设要求/软文推广媒体
  • wordpress建个人网站/太原做网站哪家好
  • 网站空间维护/seo关键词排名优化品牌
  • 群晖wordpress设置/郑州百度seo
  • 杭州哪家公司网站做的好/站长之家0
  • 空间网站模板/关键词优化到首页怎么做到的
  • 平板上做网站的软件/关键词搜索优化外包
  • 山东定制型网站建设推广/网站如何优化关键词排名
  • 申请网页域名/百度seo优化系统
  • 网站界面一般用什么软件做/seo推广优化的方法
  • 网站后台文档/汕头网络营销公司
  • 昭通市住房和城乡建设局网站/网络营销活动方案
  • 在网站中调用在线客服/著名的个人网站
  • 从化低价网站建设/网站如何做seo排名
  • 福建微网站建设公司推荐/站长之家端口扫描
  • 长沙做个网站多少钱/百度商家平台登录
  • 网站建设营销一站式服务/营销策略案例
  • 松原手机网站开发公司/nba排名
  • 网站链接锚点怎么做/广西seo关键词怎么优化
  • 做网站都需要什么软件/友情链接怎么交换
  • 网址导航类网站怎么做/搜索引擎营销的分类
  • 想给公司注册一个网站/官网优化包括什么内容
  • 天津做艺术品的网站/免费网站推广软件