Hi all,
I am new to Julia.
I have been trying to rewrite my Python code in Julia for performance.
For this, I need to import the python module “fuzzywuzzy”. Its a string matching module. I have successfully imported pandas and numpy but not fuzzywuzzy.
using Pkg
ENV["PYTHON"] = "/Users/jithin/opt/anaconda3/bin/python"
Pkg.build("PyCall")
using PyCall
pd = pyimport("pandas")
fuzz = pyimport("fuzzywuzzy")
I get the following error:
PyError (PyImport_ImportModule
The Python package fuzzywuzzy could not be found by pyimport. Usually this means
that you did not install fuzzywuzzy in the Python version being used by PyCall.
PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package. To install the fuzzywuzzy module, you can
use pyimport_conda("fuzzywuzzy", PKG)
, where PKG is the Anaconda
package the contains the module fuzzywuzzy, or alternatively you can use the
Conda package directly (via using Conda
followed by Conda.add
etcetera).
Alternatively, if you want to use a different Python distribution on your
system, such as a system-wide Python (as opposed to the Julia-specific Python),
you can re-configure PyCall with that Python. As explained in the PyCall
documentation, set ENV[“PYTHON”] to the path/name of the python executable
you want to use, run Pkg.build(“PyCall”), and re-launch Julia.
) <class ‘ModuleNotFoundError’>
ModuleNotFoundError(“No module named ‘fuzzywuzzy’”)
Stacktrace:
[1] pyimport(::String) at /Users/jithin/.julia/packages/PyCall/zqDXB/src/PyCall.jl:536
[2] top-level scope at In[39]:1