{"id":7616,"date":"2019-11-06T02:03:01","date_gmt":"2019-11-06T02:03:01","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=7616"},"modified":"2022-07-24T10:16:22","modified_gmt":"2022-07-24T10:16:22","slug":"list-of-python-environment-variables","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/list-of-python-environment-variables\/","title":{"rendered":"Python Tutorials: List of Python Environment Variables"},"content":{"rendered":"\n<p>Here are important environment variables, which can be recognized by Python \u2212<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><th>Sr.No.<\/th><th>Variable &amp; Description<\/th><\/tr><tr><td>1<\/td><td><strong>PYTHONPATH<\/strong>It has a role similar to PATH. This variable tells the Python interpreter where to locate the module files imported into a program. It should include the Python source library directory and the directories containing Python source code. PYTHONPATH is sometimes preset by the Python installer.<\/td><\/tr><tr><td>2<\/td><td><strong>PYTHONSTARTUP<\/strong>It contains the path of an initialization file containing Python source code. It is executed every time you start the interpreter. It is named as .pythonrc.py in Unix and it contains commands that load utilities or modify PYTHONPATH.<\/td><\/tr><tr><td>3<\/td><td><strong>PYTHONCASEOK<\/strong>It is used in Windows to instruct Python to find the first case-insensitive match in an import statement. Set this variable to any value to activate it.<\/td><\/tr><tr><td>4<\/td><td><strong>PYTHONHOME<\/strong>It is an alternative module search path. It is usually embedded in the PYTHONSTARTUP or PYTHONPATH directories to make switching module libraries easy.<br><\/td><\/tr><tr><td>5<\/td><td><strong>PYTHONIOENCODING<\/strong> &#8211; Encoding[:errors] used for stdin\/stdout\/stderr.<\/td><\/tr><tr><td>6<\/td><td><strong>PYTHONFAULTHANDLER<\/strong> &#8211; dump the Python traceback on fatal errors.<\/td><\/tr><tr><td>7<\/td><td><strong>PYTHONHASHSEED<\/strong> &#8211; if this variable is set to &#8216;random&#8217;, a random value is used<br>    to seed the hashes of str and bytes objects.  It can also be set to an<br>    integer in the range [0,4294967295] to get hash values with a<br>    predictable seed.<\/td><\/tr><tr><td>8<\/td><td><strong>PYTHONMALLOC<\/strong> &#8211; set the Python memory allocators and\/or install debug hooks on Python memory allocators. Use PYTHONMALLOC=debug to install debug hooks.<\/td><\/tr><tr><td>9 <\/td><td><strong>PYTHONCOERCECLOCALE<\/strong> &#8211; if this variable is set to 0, it disables the lcale coercion behavior. Use PYTHONCOERCECLOCALE=warn to request display of locale coercion and locale compatibility warnings on stderr.<\/td><\/tr><tr><td>10<\/td><td><strong>PYTHONBREAKPOINT<\/strong> &#8211; if this variable is set to 0, it disables the default<br>    debugger. It can be set to the callable of your debugger of choice.<br> PYTHONDEVMODE: enable the development mode.<\/td><\/tr><tr><td>11<\/td><td><strong>PYTHONPYCACHEPREFIX<\/strong> &#8211; root directory for bytecode cache (pyc) files.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_18517\"><iframe loading=\"lazy\"  id=\"_ytid_48049\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_18517\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Here are important environment variables, which can be recognized by Python \u2212 Sr.No. Variable &amp; Description 1 PYTHONPATHIt has a role similar to PATH. This variable tells the Python interpreter&#8230; <\/p>\n","protected":false},"author":1,"featured_media":7621,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[499],"tags":[5449,1072,176,317],"class_list":["post-7616","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-programming-scripting-languages","tag-devopsschool","tag-environment","tag-python","tag-variables"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/7616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=7616"}],"version-history":[{"count":4,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/7616\/revisions"}],"predecessor-version":[{"id":30736,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/7616\/revisions\/30736"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/7621"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=7616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=7616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=7616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}