OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Python: How to fix "pyenv: bash: command not found"

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

Guest
I use pyenv to manage my Python environments and I get the following when simply running bash.

Code:
$ bash
pyenv: bash: command not found

I was trying to troubleshoot why pipenv shell failed with the above error, which is how I found out even bash wasn't working. I tried updating pipenv via brew and ran pyenv rehash to regenerate the shims. And bash is definitely present.

Code:
$ which bash
/bin/bash

I expected that if pyenv doesn't find a command, the subsequent paths specified by the PATH environment variable will be searched. Interestingly if I execute some non-existant command I don't get a pyenv error.

Code:
$ someboguscommand
-bash: someboguscommand: command not found

This suggests to me that pyenv doesn't even search for a matching command in this case and the subsequent paths in PATH are searched, so there must be some special handling with bash.
<p>I use <code>pyenv</code> to manage my Python environments and I get the following when simply running <code>bash</code>.</p>

<pre><code>$ bash
pyenv: bash: command not found
</code></pre>

<p>I was trying to troubleshoot why <code>pipenv shell</code> failed with the above error, which is how I found out even <code>bash</code> wasn't working. I tried updating <code>pipenv</code> via <code>brew</code> and ran <code>pyenv rehash</code> to regenerate the shims. And <code>bash</code> is definitely present.</p>

<pre><code>$ which bash
/bin/bash
</code></pre>

<p>I expected that if <code>pyenv</code> doesn't find a command, the subsequent paths specified by the <code>PATH</code> environment variable will be searched. Interestingly if I execute some non-existant command I don't get a <code>pyenv</code> error.</p>

<pre><code>$ someboguscommand
-bash: someboguscommand: command not found
</code></pre>

<p>This suggests to me that <code>pyenv</code> doesn't even search for a matching command in this case and the subsequent paths in <code>PATH</code> are searched, so there must be some special handling with <code>bash</code>.</p>
 

Latest posts

Top