Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for pyenv environment creation on OSX #597

Open
bstellato opened this issue Oct 17, 2018 · 2 comments
Open

Update for pyenv environment creation on OSX #597

bstellato opened this issue Oct 17, 2018 · 2 comments

Comments

@bstellato
Copy link

I have tried the pyenv environment setup option in #122 but it did not work for me. I was not able to generate the shared library and PyCall was giving the error

ImportError: No module named site

Instead, the following command worked

env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.6.5

The difference is to use --enable-shared instead of --enable-framework. This is also described here.

@maximerischard
Copy link

I also needed the --enable-shared option on Ubuntu. Otherwise I was getting a Couldn't find libpython; check your PYTHON environment variable. error.

Note that the syntax can be simplified to CONFIGURE_OPTS=--enable-shared pyenv install -f 3.6.5.

@cmcbride
Copy link

I am not sure if I should raise a different issue, but using the --enable-shared did resolve my problem so I'm just commenting here for now.

In short, not having the shared library on the python executable installed from pyenv somehow got PyCall to generate an inconsistent deps.jl (it found my 3.8.7 python, but tried to set the libpython to a 2.7 version)

[nibbler deps]% pwd
/Users/cmcbride/.julia/packages/PyCall/tqyST/deps
[nibbler deps]% which python
/Users/cmcbride/.pyenv/shims/python
[nibbler deps]% python --version
Python 3.8.7
[nibbler deps]% python find_libpython.py
/Users/cmcbride/.pyenv/versions/3.8.7/lib/python3.8/config-3.8-darwin/libpython3.8.a%
[nibbler deps]% /usr/local/bin/python find_libpython.py
/usr/local/Cellar/python@2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/Python%
[nibbler deps]% cat deps.jl
const python = "/Users/cmcbride/.pyenv/versions/3.8.7/bin/python"
const libpython = "/System/Library/Frameworks/Python.framework/Versions/2.7/Python"
const pyprogramname = "/Users/cmcbride/.pyenv/versions/3.8.7/bin/python"
const pyversion_build = v"3.8.7"
const PYTHONHOME = "/Users/cmcbride/.pyenv/versions/3.8.7:/Users/cmcbride/.pyenv/versions/3.8.7"
"True if we are using the Python distribution in the Conda package."
const conda = false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants