Why is program not found in PATH [duplicate]

Clash Royale CLAN TAG#URR8PPP
This question is an exact duplicate of:
The python command starts the the wrong version of the python interpreter
2 answers
I've installed ipython inside virtualenv on my macOS. My PATH environment variable also shows virtualenv path to be at the beginning. which command also shows that ipython at the correct location.
The problem is, when I run ipython, the shell is finding the previous installation in an odd place. Here's some examples:
(csv_import) $ ipython
-bash: /usr/local/bin/ipython: /usr/local/opt/python3/bin/python3.6: bad interpreter: No such file or directory
(csv_import) $
(csv_import) $ which ipython
/Users/zeinep/.virtualenvs/csv_import/bin/ipython
(csv_import) $
(csv_import) $ echo $PATH
/Users/zeinep/.virtualenvs/csv_import/bin:/Users/zeinep/.avn/bin:/Users/zeinep/.nvm/versions/node/v10.14.1/bin:/usr/local/lib/python3.6/bin:/Users/zeinep/Library/Python/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
(csv_import) $
(csv_import) $
(csv_import) $ /Users/zeinep/.virtualenvs/csv_import/bin/ipython
Python 3.6.5 (default, Jun 17 2018, 12:13:06)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.3.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]:
As can be seen, if I use a full path, it works. Otherwise, old installation at /usr/local/bin/ipython is run even though the shell should be finding the one in in virtualenv as far as I can see.
bash path
marked as duplicate by JdeBP, Jeff Schaller♦
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Feb 28 at 17:23
This question was marked as an exact duplicate of an existing question.
add a comment |
This question is an exact duplicate of:
The python command starts the the wrong version of the python interpreter
2 answers
I've installed ipython inside virtualenv on my macOS. My PATH environment variable also shows virtualenv path to be at the beginning. which command also shows that ipython at the correct location.
The problem is, when I run ipython, the shell is finding the previous installation in an odd place. Here's some examples:
(csv_import) $ ipython
-bash: /usr/local/bin/ipython: /usr/local/opt/python3/bin/python3.6: bad interpreter: No such file or directory
(csv_import) $
(csv_import) $ which ipython
/Users/zeinep/.virtualenvs/csv_import/bin/ipython
(csv_import) $
(csv_import) $ echo $PATH
/Users/zeinep/.virtualenvs/csv_import/bin:/Users/zeinep/.avn/bin:/Users/zeinep/.nvm/versions/node/v10.14.1/bin:/usr/local/lib/python3.6/bin:/Users/zeinep/Library/Python/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
(csv_import) $
(csv_import) $
(csv_import) $ /Users/zeinep/.virtualenvs/csv_import/bin/ipython
Python 3.6.5 (default, Jun 17 2018, 12:13:06)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.3.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]:
As can be seen, if I use a full path, it works. Otherwise, old installation at /usr/local/bin/ipython is run even though the shell should be finding the one in in virtualenv as far as I can see.
bash path
marked as duplicate by JdeBP, Jeff Schaller♦
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Feb 28 at 17:23
This question was marked as an exact duplicate of an existing question.
What operating system are you using? Is that macOS?
– terdon♦
Feb 28 at 14:54
@terdon yes, this is macOS
– tayfun
Feb 28 at 15:00
OK. If you've installed in in a virtualenv, why are you trying to run it outside the virtualenv? Does it work of you do. /Users/zeinep/.virtualenvs/csv_import/bin/activate(or whatever the right command is to activate the virtualenv) and then runipython?
– terdon♦
Feb 28 at 15:02
1
@JeffSchaller it seems like that solved it! Thanks!
– tayfun
Feb 28 at 15:02
@terdon it's inside virtualenv. That(csv_import)at the beginning is telling me I'm inside the virtual env.
– tayfun
Feb 28 at 15:03
add a comment |
This question is an exact duplicate of:
The python command starts the the wrong version of the python interpreter
2 answers
I've installed ipython inside virtualenv on my macOS. My PATH environment variable also shows virtualenv path to be at the beginning. which command also shows that ipython at the correct location.
The problem is, when I run ipython, the shell is finding the previous installation in an odd place. Here's some examples:
(csv_import) $ ipython
-bash: /usr/local/bin/ipython: /usr/local/opt/python3/bin/python3.6: bad interpreter: No such file or directory
(csv_import) $
(csv_import) $ which ipython
/Users/zeinep/.virtualenvs/csv_import/bin/ipython
(csv_import) $
(csv_import) $ echo $PATH
/Users/zeinep/.virtualenvs/csv_import/bin:/Users/zeinep/.avn/bin:/Users/zeinep/.nvm/versions/node/v10.14.1/bin:/usr/local/lib/python3.6/bin:/Users/zeinep/Library/Python/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
(csv_import) $
(csv_import) $
(csv_import) $ /Users/zeinep/.virtualenvs/csv_import/bin/ipython
Python 3.6.5 (default, Jun 17 2018, 12:13:06)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.3.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]:
As can be seen, if I use a full path, it works. Otherwise, old installation at /usr/local/bin/ipython is run even though the shell should be finding the one in in virtualenv as far as I can see.
bash path
This question is an exact duplicate of:
The python command starts the the wrong version of the python interpreter
2 answers
I've installed ipython inside virtualenv on my macOS. My PATH environment variable also shows virtualenv path to be at the beginning. which command also shows that ipython at the correct location.
The problem is, when I run ipython, the shell is finding the previous installation in an odd place. Here's some examples:
(csv_import) $ ipython
-bash: /usr/local/bin/ipython: /usr/local/opt/python3/bin/python3.6: bad interpreter: No such file or directory
(csv_import) $
(csv_import) $ which ipython
/Users/zeinep/.virtualenvs/csv_import/bin/ipython
(csv_import) $
(csv_import) $ echo $PATH
/Users/zeinep/.virtualenvs/csv_import/bin:/Users/zeinep/.avn/bin:/Users/zeinep/.nvm/versions/node/v10.14.1/bin:/usr/local/lib/python3.6/bin:/Users/zeinep/Library/Python/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
(csv_import) $
(csv_import) $
(csv_import) $ /Users/zeinep/.virtualenvs/csv_import/bin/ipython
Python 3.6.5 (default, Jun 17 2018, 12:13:06)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.3.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]:
As can be seen, if I use a full path, it works. Otherwise, old installation at /usr/local/bin/ipython is run even though the shell should be finding the one in in virtualenv as far as I can see.
This question is an exact duplicate of:
The python command starts the the wrong version of the python interpreter
2 answers
bash path
bash path
edited Feb 28 at 15:00
terdon♦
133k32265444
133k32265444
asked Feb 28 at 14:49
tayfuntayfun
1033
1033
marked as duplicate by JdeBP, Jeff Schaller♦
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Feb 28 at 17:23
This question was marked as an exact duplicate of an existing question.
marked as duplicate by JdeBP, Jeff Schaller♦
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Feb 28 at 17:23
This question was marked as an exact duplicate of an existing question.
What operating system are you using? Is that macOS?
– terdon♦
Feb 28 at 14:54
@terdon yes, this is macOS
– tayfun
Feb 28 at 15:00
OK. If you've installed in in a virtualenv, why are you trying to run it outside the virtualenv? Does it work of you do. /Users/zeinep/.virtualenvs/csv_import/bin/activate(or whatever the right command is to activate the virtualenv) and then runipython?
– terdon♦
Feb 28 at 15:02
1
@JeffSchaller it seems like that solved it! Thanks!
– tayfun
Feb 28 at 15:02
@terdon it's inside virtualenv. That(csv_import)at the beginning is telling me I'm inside the virtual env.
– tayfun
Feb 28 at 15:03
add a comment |
What operating system are you using? Is that macOS?
– terdon♦
Feb 28 at 14:54
@terdon yes, this is macOS
– tayfun
Feb 28 at 15:00
OK. If you've installed in in a virtualenv, why are you trying to run it outside the virtualenv? Does it work of you do. /Users/zeinep/.virtualenvs/csv_import/bin/activate(or whatever the right command is to activate the virtualenv) and then runipython?
– terdon♦
Feb 28 at 15:02
1
@JeffSchaller it seems like that solved it! Thanks!
– tayfun
Feb 28 at 15:02
@terdon it's inside virtualenv. That(csv_import)at the beginning is telling me I'm inside the virtual env.
– tayfun
Feb 28 at 15:03
What operating system are you using? Is that macOS?
– terdon♦
Feb 28 at 14:54
What operating system are you using? Is that macOS?
– terdon♦
Feb 28 at 14:54
@terdon yes, this is macOS
– tayfun
Feb 28 at 15:00
@terdon yes, this is macOS
– tayfun
Feb 28 at 15:00
OK. If you've installed in in a virtualenv, why are you trying to run it outside the virtualenv? Does it work of you do
. /Users/zeinep/.virtualenvs/csv_import/bin/activate (or whatever the right command is to activate the virtualenv) and then run ipython?– terdon♦
Feb 28 at 15:02
OK. If you've installed in in a virtualenv, why are you trying to run it outside the virtualenv? Does it work of you do
. /Users/zeinep/.virtualenvs/csv_import/bin/activate (or whatever the right command is to activate the virtualenv) and then run ipython?– terdon♦
Feb 28 at 15:02
1
1
@JeffSchaller it seems like that solved it! Thanks!
– tayfun
Feb 28 at 15:02
@JeffSchaller it seems like that solved it! Thanks!
– tayfun
Feb 28 at 15:02
@terdon it's inside virtualenv. That
(csv_import) at the beginning is telling me I'm inside the virtual env.– tayfun
Feb 28 at 15:03
@terdon it's inside virtualenv. That
(csv_import) at the beginning is telling me I'm inside the virtual env.– tayfun
Feb 28 at 15:03
add a comment |
1 Answer
1
active
oldest
votes
You apparently added /Users/zeinep/.virtualenvs/csv_import/bin to your $PATH after bash had saved (hashed) the /usr/local/bin version. The fix is as simple as hash -d ipython.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You apparently added /Users/zeinep/.virtualenvs/csv_import/bin to your $PATH after bash had saved (hashed) the /usr/local/bin version. The fix is as simple as hash -d ipython.
add a comment |
You apparently added /Users/zeinep/.virtualenvs/csv_import/bin to your $PATH after bash had saved (hashed) the /usr/local/bin version. The fix is as simple as hash -d ipython.
add a comment |
You apparently added /Users/zeinep/.virtualenvs/csv_import/bin to your $PATH after bash had saved (hashed) the /usr/local/bin version. The fix is as simple as hash -d ipython.
You apparently added /Users/zeinep/.virtualenvs/csv_import/bin to your $PATH after bash had saved (hashed) the /usr/local/bin version. The fix is as simple as hash -d ipython.
answered Feb 28 at 15:04
Jeff Schaller♦Jeff Schaller
44k1161142
44k1161142
add a comment |
add a comment |
What operating system are you using? Is that macOS?
– terdon♦
Feb 28 at 14:54
@terdon yes, this is macOS
– tayfun
Feb 28 at 15:00
OK. If you've installed in in a virtualenv, why are you trying to run it outside the virtualenv? Does it work of you do
. /Users/zeinep/.virtualenvs/csv_import/bin/activate(or whatever the right command is to activate the virtualenv) and then runipython?– terdon♦
Feb 28 at 15:02
1
@JeffSchaller it seems like that solved it! Thanks!
– tayfun
Feb 28 at 15:02
@terdon it's inside virtualenv. That
(csv_import)at the beginning is telling me I'm inside the virtual env.– tayfun
Feb 28 at 15:03