all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Larry Evans <cppljevans@suddenlink.net>
To: help-gnu-emacs@gnu.org
Subject: Re: emacs doesn't inherit PATH from environment
Date: Tue, 13 Feb 2018 17:57:17 -0600	[thread overview]
Message-ID: <p5vtt0$j6s$1@blaine.gmane.org> (raw)
In-Reply-To: <864lmkhff0.fsf@zoho.com>

On 02/13/2018 01:12 PM, Emanuel Berg wrote:
> Larry Evans wrote:
> 
>> When executing a Makefile or invoking eshell,
>> the PATH is not the same as when running from
>> a terminal window. Even when I modify the
>> PATH in the emacs initialization code in
>> ~/emacs.d/init.common.el, the executables in
>> the PATH are *not* found.
> 
> Where and how do you set PATH?
> 
> Shell stuff that I want available from Emacs
> I have to set in a special file for zsh, which
> is
> 
>      ~/.zshenv
> 
> If I put the same thing in plain .zshrc or
> a file loaded from there, it doesn't work!
> 
> I never understood why because the Emacs
> instance is run from a zsh shell, but for some
> reason Emacs cannot see zsh stuff that aren't
> defined in that special file, even when (as
> said) executed from a point which HAS access to
> it all!
> 
> My experience with this has only been
> *functions*, not environmentals, but it is
> worth a shot.
> 
> Also, you can use this to check the value prior
> to starting the shell and Makefile compilation
> session:
> 
>      (getenv "PATH")
> 
> Is it correct?
> 
Thanks for your feedback, Emanuel.

Yes, PATH is correct; however, I did use a different method to show its 
value:

Here's my Makefile:

--{--cut here--
which:
	echo "PATH=$(PATH)"
	ls -ld /home/evansl/anaconda3/bin/pdf2txt.py
	which pdf2txt.py
--}--cut here--
and heres the make invocation from within emacs:
--{--cut here--
-*- mode: compilation; default-directory: 
"~/prog_dev/python/pdfminer/pdfminer/" -*-
Compilation started at Tue Feb 13 17:47:05

echo $PATH ; make -k which
/home/evansl/anaconda3/bin;/home/evansl/miniconda3/bin;/home/evansl/dwnlds/depot_tools/depot_tools:/home/evansl/dwnlds/gsrc.top/install/bin:/home/evansl/bin:/opt/OpenPrinting-Gutenprint/sbin:/opt/OpenPrinting-Gutenprint/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
echo 
"PATH=/home/evansl/anaconda3/bin;/home/evansl/miniconda3/bin;/home/evansl/dwnlds/depot_tools/depot_tools:/home/evansl/dwnlds/gsrc.top/install/bin:/home/evansl/bin:/opt/OpenPrinting-Gutenprint/sbin:/opt/OpenPrinting-Gutenprint/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
PATH=/home/evansl/anaconda3/bin;/home/evansl/miniconda3/bin;/home/evansl/dwnlds/depot_tools/depot_tools:/home/evansl/dwnlds/gsrc.top/install/bin:/home/evansl/bin:/opt/OpenPrinting-Gutenprint/sbin:/opt/OpenPrinting-Gutenprint/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
ls -ld /home/evansl/anaconda3/bin/pdf2txt.py
-rwxrwxr-x 1 evansl evansl 3436 Feb 12 06:18 
/home/evansl/anaconda3/bin/pdf2txt.py
which pdf2txt.py
Makefile:29: recipe for target 'which' failed
make: *** [which] Error 1

Compilation exited abnormally with code 2 at Tue Feb 13 17:47:05
--}--cut here--
and before doing all that, I created a ~/.bashenv using the
name pattern you gave in your post (~/.$(SHELL)env):

--{--cut here--
evansl@lje-OptiPlex-9020:~$ pwd
/home/evansl
evansl@lje-OptiPlex-9020:~$ cat .bashenv
#let emacs know the environment
. .bashrc
evansl@lje-OptiPlex-9020:~$ tail .bashrc
fi

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm

# added by Miniconda3 installer
export PATH="/home/evansl/miniconda3/bin:$PATH"

# added by Anaconda3 installer
export PATH="/home/evansl/anaconda3/bin:$PATH"
evansl@lje-OptiPlex-9020:~$
--}--cut here--

So, I still can't figure how to get emacs to find pdf2txt.py in
home/evansl/anaconda3/bin/ by setting PATH somehow.

-regards,
Larry




  reply	other threads:[~2018-02-13 23:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.8985.1518453550.27995.help-gnu-emacs@gnu.org>
2018-02-13 19:12 ` emacs doesn't inherit PATH from environment Emanuel Berg
2018-02-13 23:57   ` Larry Evans [this message]
     [not found]   ` <mailman.9069.1518566292.27995.help-gnu-emacs@gnu.org>
2018-02-14  0:11     ` Emanuel Berg
2018-02-14  0:48       ` Larry Evans
2018-02-14  1:45         ` Robert Thorpe
2018-02-14  2:35           ` Larry Evans
     [not found]       ` <mailman.9071.1518569365.27995.help-gnu-emacs@gnu.org>
2018-02-14  1:23         ` Emanuel Berg
2018-02-14  1:25         ` Emanuel Berg
2018-02-14  1:32   ` Robert Thorpe
2018-02-14 19:19   ` Bastian Beischer
     [not found]   ` <mailman.9115.1518635972.27995.help-gnu-emacs@gnu.org>
2018-02-16 17:14     ` Emanuel Berg
     [not found] <mailman.9076.1518571984.27995.help-gnu-emacs@gnu.org>
2018-02-14  1:43 ` Emanuel Berg
2018-02-12 15:51 Larry Evans
2018-02-14  1:27 ` Glenn Morris
2018-02-14  2:24   ` Larry Evans
2018-02-14 14:53     ` Larry Evans
2018-02-14 23:18       ` Robert Thorpe
2018-02-15  1:03         ` Larry Evans
2018-02-15  2:38           ` Bob Proulx
     [not found]           ` <mailman.9140.1518662330.27995.help-gnu-emacs@gnu.org>
2018-02-15 15:59             ` Barry Fishman
2018-02-15 20:18               ` Bob Proulx
     [not found]         ` <mailman.9127.1518652911.27995.help-gnu-emacs@gnu.org>
2018-02-16 16:58           ` Emanuel Berg
     [not found]     ` <mailman.9096.1518616283.27995.help-gnu-emacs@gnu.org>
2018-02-16 16:54       ` Emanuel Berg
     [not found] ` <mailman.9075.1518571658.27995.help-gnu-emacs@gnu.org>
2018-02-14  1:38   ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='p5vtt0$j6s$1@blaine.gmane.org' \
    --to=cppljevans@suddenlink.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.