{"id":8486,"date":"2018-05-21T17:42:56","date_gmt":"2018-05-22T00:42:56","guid":{"rendered":"http:\/\/www.yuleshow.com\/?p=8486"},"modified":"2018-05-21T17:42:56","modified_gmt":"2018-05-22T00:42:56","slug":"modify-the-emacs-shell-path-environment","status":"publish","type":"post","link":"https:\/\/www.yuleshow.com\/?p=8486","title":{"rendered":"Modify the emacs shell path environment"},"content":{"rendered":"<p>Do you remember this article? Traditional and Simplified Chinese convert under emacs. \u00a0In that, I use hancovnert emacs lisp to convert between simplified Chinese and traditional Chinese and vice versa.\u00a0 Actually, it works on my T430 which is an Ubuntu platform but doesn&#8217;t work on my Mac.<br \/>\nI don&#8217;t remember it worked on it or not, but it doesn&#8217;t anyway. I studied the situation. The error message is that in emacs the python can&#8217;t import a module called chardet, but when I use pip to install it again it shows already exist. The results from<\/p>\n<pre>which python<\/pre>\n<p>are different between the terminal and emacs shell. Terminal uses \/usr\/local\/bin\/python but emacs shell uses \/usr\/bin\/python, the later one doesn&#8217;t recognize the pip installed modules.<br \/>\nNow, easy, the solution is that let emacs call the right python, put the \/usr\/local\/bin to the highest priority, then problem solved.<br \/>\nSimple, add one line in the .emacs to change the shell&#8217;s $path.<\/p>\n<pre> (setenv \"PATH\" (concat \"\/usr\/local\/bin\" \":\" (getenv \"PATH\")))<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do you remember this article? Traditional and Simplified Chinese convert under emacs. \u00a0In that, I use hancovnert emacs lisp to convert between simplified Chinese and traditional Chinese and vice versa.\u00a0 Actually, it works on my T430 which is an Ubuntu platform but doesn&#8217;t work on my Mac. I don&#8217;t remember it worked on it or [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[34,43,44],"tags":[],"class_list":["post-8486","post","type-post","status-publish","format-standard","hentry","category-emacs","category-linux","category-mac-ios"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=\/wp\/v2\/posts\/8486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8486"}],"version-history":[{"count":0,"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=\/wp\/v2\/posts\/8486\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yuleshow.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}