pyenv seems to be not respecting PATH

Created on 4 Oct 2018  Â·  3Comments  Â·  Source: pyenv/pyenv

Too many issues will kill our team's development velocity, drastically.
Make sure you have checked all steps below.

Prerequisite

  • [x] Make sure your problem is not listed in the common build problems.
  • [x] Make sure no duplicated issue has already been reported in the pyenv issues. You should look for closed issues, too. - Closest I can find is #893 | #843 all which don't directly touch on the issue
  • [x] Make sure you are not asking us to help solving your specific issue.

    • GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like Gitter, StackOverflow, etc.

  • [x] Make sure your problem is not derived from packaging (e.g. Homebrew).

    • Please refer to the package documentation for the installation issues, etc.

  • [x] Make sure your problem is not derived from plugins.

    • This repository is maintaining pyenv and the default python-build plugin only. Please refrain from reporting issues of other plugins here.

Description

  • [x] Platform information (e.g. Ubuntu Linux 16.04): MacOS 10.13.6
  • [x] OS architecture (e.g. amd64): amd64
  • [x] pyenv version: 1.2.7
  • [x] Python version: 3.7.0 (pyenv-set) | 2.7.10 (system)
  • [x] C Compiler information (e.g. gcc 7.3): apple clang 10.0.0 (clang-1000.10.44.2)
  • [x] [Please attach verbose build log as gist](https://gist.github.com/bowerscd/bea2cb04bd82840ddacbc94de64c67ec)

    • You can turn on verbose debug logging using by setting PYENV_DEBUG=1, e.g. env PYENV_DEBUG=1 pyenv install -v 3.6.4

pyenv seems to be ignoring the PATH variable for finding binaries. In this case, specifically, it's clang. In the gist you can see that PATH is:

PATH='/usr/local/Cellar/pyenv/1.2.7/libexec:/Users/<USER>/.pyenv/shims:/Users/<USER>/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin'

clang can be found in /usr/bin/clang:

pc:voice <USER>$ ls /usr/bin/clang
-rwxr-xr-x  1 root  wheel  18288 Jul  4 02:07 /usr/bin/clang

but pyenv which clang reports command not found:

pc:voice <USER>$ pyenv which clang
pyenv: clang: command not found

This makes it difficult to install pip packages that require compilation (hmmlearn, for example), though a work-around I've found is exporting CC=clang, for certain packages.

macOS

Most helpful comment

I get a similar behaviour on MacOS 10.12.6 and pyenv 1.2.4.
As a note, I use the pyenv-virtualenv and pyenv-virtualenvwrapper plugin.

A binary in /usr/local/bin installed via Homebrew won't get found by pyenv when I am not in the system python version.

When in the system python:

➜ pyenv which raiden
/usr/local/bin/raiden

When I set a "shell" virtualenv (named global):

➜ pyenv shell global
(global)

➜ pyenv which raiden
pyenv: raiden: command not found

All 3 comments

I get a similar behaviour on MacOS 10.12.6 and pyenv 1.2.4.
As a note, I use the pyenv-virtualenv and pyenv-virtualenvwrapper plugin.

A binary in /usr/local/bin installed via Homebrew won't get found by pyenv when I am not in the system python version.

When in the system python:

➜ pyenv which raiden
/usr/local/bin/raiden

When I set a "shell" virtualenv (named global):

➜ pyenv shell global
(global)

➜ pyenv which raiden
pyenv: raiden: command not found

Yeah, this seems to be the underlying issue for a lot of errors I ran into trying to fix my checking whether the C compiler works... no issue.
Settings all kinds of flags leads to other errors I see reported here and on stackoverflow which wasn't a fix for me.

In the end what worked for me is
pyenv --debug install <version> where version is a cpython version.
Then manually going to the working tree folder and running the python-build <version> /Users/hvdklauw/.pyenv/versions/<version> command.

That would run just fine and install the version for python without issue.

Should note that this is pyenv 1.2.11 (and HEAD) installed through homebrew on os 10.14.4.

Something about how the brew installation works is a problem -- this all works fine on Linux, but I am running into the same issue on OSX.

I tried just using the install script: https://github.com/pyenv/pyenv-installer and things work properly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thedrow picture thedrow  Â·  3Comments

paugier picture paugier  Â·  3Comments

tasugi picture tasugi  Â·  3Comments

bryant1410 picture bryant1410  Â·  3Comments

ydaniju picture ydaniju  Â·  3Comments