# Pyimport() fuzzywuzzy (python module) error

**URL:** <https://discourse.julialang.org/t/pyimport-fuzzywuzzy-python-module-error/41187>\
**Category:** General Usage\
**Tags:** question, package\
**Created:** [June 11, 2020, 8:37am UTC](https://discourse.julialang.org/t/pyimport-fuzzywuzzy-python-module-error/41187 "2020-06-11T08:37:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![john0017](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@john0017](https://discourse.julialang.org/u/john0017)\
**Post date:** [June 11, 2020, 8:37am UTC](https://discourse.julialang.org/t/pyimport-fuzzywuzzy-python-module-error/41187/1 "2020-06-11T08:37:04Z")

</div>

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.

```julia
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

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [June 11, 2020, 8:46am UTC](https://discourse.julialang.org/t/pyimport-fuzzywuzzy-python-module-error/41187/2 "2020-06-11T08:46:50Z")

</div>

Not an answer to your question, but if you’re looking to do what fuzzywuzzy does in Julia consider [GitHub - matthieugomez/StringDistances.jl: String Distances in Julia](https://github.com/matthieugomez/StringDistances.jl)

---

<div class="post-metadata">

**Author:** ![marius311](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marius311/32/3953_2.png) [@marius311](https://discourse.julialang.org/u/marius311)\
**Post date:** [June 11, 2020, 8:51am UTC](https://discourse.julialang.org/t/pyimport-fuzzywuzzy-python-module-error/41187/3 "2020-06-11T08:51:11Z")

</div>

> [@john0017](#):
>
> PyCall is currently configured to use the Julia-specific Python distribution  
> installed by the Conda.jl package

The fact that it says that^ instead of

```julia
PyCall is currently configured to use the Python version at:

/Users/jithin/opt/anaconda3/bin/python

```

means something about your build command must not have worked right. Can you try it again and make sure you restart Julia after building?

---

<div class="post-metadata">

**Author:** ![john0017](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@john0017](https://discourse.julialang.org/u/john0017)\
**Post date:** [June 11, 2020, 8:56am UTC](https://discourse.julialang.org/t/pyimport-fuzzywuzzy-python-module-error/41187/4 "2020-06-11T08:56:13Z")

</div>

> [@nilshg](#):
>
> [GitHub - matthieugomez/StringDistances.jl: String Distances in Julia](https://github.com/matthieugomez/StringDistances.jl)

That is my plan B to this problem, also party inspired from one of your posts here, from '18. However, i just have to know why this doesn’t work. 😅  
thank you @nilshg🙂

---

<div class="post-metadata">

**Author:** ![john0017](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@john0017](https://discourse.julialang.org/u/john0017)\
**Post date:** [June 11, 2020, 9:02am UTC](https://discourse.julialang.org/t/pyimport-fuzzywuzzy-python-module-error/41187/5 "2020-06-11T09:02:55Z")

</div>

DAMN!!! IT WORKED!

“faith restored” 😆

I spent all night banging my head over this! Thank you @marius311 😊
