{"id":132,"date":"2016-06-25T16:29:15","date_gmt":"2016-06-25T08:29:15","guid":{"rendered":"http:\/\/www.sunpengcheng.com\/?p=132"},"modified":"2016-06-25T16:44:32","modified_gmt":"2016-06-25T08:44:32","slug":"setup-python","status":"publish","type":"post","link":"https:\/\/www.sunpengcheng.com\/index.php\/2016\/06\/25\/setup-python\/","title":{"rendered":"Setup Python"},"content":{"rendered":"<p>1.Creating virtual environments.<\/p>\n<p>On Windows,just run the command like this.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.sunpengcheng.com\/wp-content\/uploads\/2016\/06\/09.jpg\" width=\"665\" height=\"428\" \/><\/p>\n<p>if you don&#8217;t have the relevant PATH settings,you may have to invoke the pyvenv script as follows.<\/p>\n<pre class=\"\">c:\\Python35\\python c:\\Python35\\Tools\\Scripts\\pyvenv.py venv<\/pre>\n<p>A virtural environments directory will be created when you run the command<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.sunpengcheng.com\/wp-content\/uploads\/2016\/06\/10.jpg\" width=\"849\" height=\"596\" \/><\/p>\n<p>2.Activate the virtual environments.<\/p>\n<p>Once a venv has been created,it can be &#8220;activated&#8221; using a script in the venv&#8217;s binary directory,on Windows,in the Command-Prompt,we can run<\/p>\n<pre class=\"\">venv\\Scripts\\activate.bat<\/pre>\n<p>to activate the virtual environments directly.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.sunpengcheng.com\/wp-content\/uploads\/2016\/06\/11.jpg\" width=\"665\" height=\"429\" \/><\/p>\n<p>3.Install Flask.<\/p>\n<p>Now,we are in the activated virtual environments,just run<\/p>\n<pre class=\"\">pip install Flask<\/pre>\n<p>command,a few seconds later,the installation is complete.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.sunpengcheng.com\/wp-content\/uploads\/2016\/06\/13.jpg\" width=\"664\" height=\"428\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.sunpengcheng.com\/wp-content\/uploads\/2016\/06\/14.jpg\" width=\"665\" height=\"428\" \/><\/p>\n<p>4.Install pypyodbc<\/p>\n<p>Still in virtual environments in Ccommand-Prompt,just run<\/p>\n<pre class=\"\">pip install pypyodbc<\/pre>\n<p>to install it,look at the screenshot below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.sunpengcheng.com\/wp-content\/uploads\/2016\/06\/15.jpg\" width=\"666\" height=\"428\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.Creating virtual environments. On Windows,just run th<\/p>\n<p><a class=\"moretag\" href=\"https:\/\/www.sunpengcheng.com\/index.php\/2016\/06\/25\/setup-python\/\">Continue Reading&hellip;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[39,40,38],"class_list":["post-132","post","type-post","status-publish","format-standard","hentry","category-python","tag-flask","tag-pypyodbc","tag-virtual-environments"],"_links":{"self":[{"href":"https:\/\/www.sunpengcheng.com\/index.php\/wp-json\/wp\/v2\/posts\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sunpengcheng.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sunpengcheng.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sunpengcheng.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sunpengcheng.com\/index.php\/wp-json\/wp\/v2\/comments?post=132"}],"version-history":[{"count":4,"href":"https:\/\/www.sunpengcheng.com\/index.php\/wp-json\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":136,"href":"https:\/\/www.sunpengcheng.com\/index.php\/wp-json\/wp\/v2\/posts\/132\/revisions\/136"}],"wp:attachment":[{"href":"https:\/\/www.sunpengcheng.com\/index.php\/wp-json\/wp\/v2\/media?parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sunpengcheng.com\/index.php\/wp-json\/wp\/v2\/categories?post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sunpengcheng.com\/index.php\/wp-json\/wp\/v2\/tags?post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}