I use Julia 1.6.0 (beta as of today) and would like to use a Python package plfit
via PyCall
.
Unfortunately, plfit
is not available in Anaconda and hence I cannot install it using Conda module:
julia> using Conda
julia> Conda.add("plfit")
[ Info: Running `conda install -y plfit` in root environment
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- plfit
...
How can I install this package from Julia?
You can run
pip
from Julia via thePyCall
module.Additionally, the package
plfit
has a reference to acython
package that is not present in Python in-built Julia and does not get installed automatically. Hence you need to do:Now the
plfit
package will be available for use from Julia:Finally, note that sometimes some packages installed this way might have problems finding binary Python dependencies (not the case with plfit). In that case you need to add the folder
%HOMEPATH%\.julia\conda\3\Library\bin
to yourPATH
environment variable (replace%HOMEPATH%\.julia
withJULIA_DEPOT_PATH
or an appropriate system path depending on your configuration and platform).