The following solution is based on this discussion .
Suppose you are using a Mac. Open your Terminal and use the following codes:
julia ENV["PYTHON"] = "/opt/anaconda3/envs/ENVNAME/bin/python3.8" import Pkg Pkg.build("PyCall")
ENVNAME with the name of your virtual environment.
Then you can use
PyCall. If you are using
IJulia, you need to restart it before you can use
Last modified on 2021-11-27