How to use python put in pyenv on macOS with PyCall

background

I put tensorflow with GPU enabled in python 3.6.0 which I put in pyenv.

To use it from Julia via PyCall

ENV["PYTHON"]="/Users/foo/.pyenv/versions/3.6.0/bin/python"
Pkg.build("PyCall")

And rebuild PyCall with the PYTHON environment variable

using PyCall

Then

ImportError: No module named site

Countermeasures

It seems that the cause is that libpython is a static link when inserting with pyenv. CONFIGURE_OPTS = "--enable-shared" and libpython during pyenv install It was possible to deal with it by passing the option to create by specifying the dynamic link.

CONFIGURE_OPTS="--enable-shared" pyenv install 3.6.0

Reference material

Related article

-Difference between --enable-framework and --enable-shared when building PYTHON

-Mruby-julia can now call Python from mruby -I tried aobench with julia -Plot the ellipse created by 1/7 in Julia language -To draw any point on a scatter plot in Julia language --non vorrei lavorare -I was able to run GPU-compatible Tensorflow from mruby on Windows (MSVC)

Recommended Posts

How to use python put in pyenv on macOS with PyCall
How to use tkinter with python in pyenv
How to use Ruby's PyCall to enable pyenv Python
Python: How to use async with
How to use SQLite in Python
How to use Mysql in python
Use Python in pyenv with NeoVim
How to use ChemSpider in Python
How to use FTP with Python
How to use PubChem in Python
How to install Python2.7 python3.5 with pyenv (on RHEL5 CentOS5) (2016 Nov)
[Introduction to Python] How to use class in Python?
[Itertools.permutations] How to put permutations in Python
How to work with BigQuery in Python
Memorandum on how to use gremlin python
How to use __slots__ in Python class
How to use regular expressions in Python
How to use is and == in Python
How to deal with python installation error in pyenv (BUILD FAILED)
How to use Pyenv
How to use the C library in Python
[REAPER] How to play with Reascript in Python
Strategy on how to monetize with Python Java
How to use Python Image Library in python3 series
How to use Python Kivy ④ ~ Execution on Android ~
Put Python 2.7.x on Mac OSX 10.15.5 with pyenv
[For beginners] How to use say command in python!
How to convert / restore a string with [] in python
How to do hash calculation with salt in Python
I want to use Python in the environment of pyenv + pipenv on Windows 10
Explain in detail how to make sounds with python
[Python] How to use list 1
How to run python in virtual space (for MacOS)
How to deal with pyenv initialization failure in fish 3.1.0
How to run tests in bulk with Python unittest
How to use python interactive mode with git bash
How to use Python argparse
Python: How to use pydub
[Python] How to use checkio
Autoencoder with Chainer (Notes on how to use + trainer)
I tried to summarize how to use pandas in python
How to use Django on Google App Engine / Python
How to use the model learned in Lobe in Python
How to develop in Python
[Python] How to use input ()
How to use Python lambda
[Python] How to use virtualenv
python3: How to use bottle (3)
python3: How to use bottle
How to use Python bytes
Notes on how to use StatsModels that can use linear regression and GLM in python
How to use python multiprocessing (continued 3) apply_async in class with Pool as a member
How to use Realsense's Python wrapper PyRealsense with Jetson Nano
Use Python 3 introduced with command line tools on macOS Catalina
How to extract any appointment in Google Calendar with Python
How to use the __call__ method in a Python class
[Hyperledger Iroha] Notes on how to use the Python SDK
How to use VS Code in venv environment on windows
How to use pyenv and pyenv-virtualenv in your own way
[Introduction to Udemy Python 3 + Application] 36. How to use In and Not
Install pyenv on MacBook Air and switch python to use