# MethodError: no method matching!

**URL:** https://discourse.julialang.org/t/methoderror-no-method-matching/73098
**Category:** New to Julia
**Created:** [December 14, 2021, 9:23pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching/73098 "2021-12-14T21:23:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Sahar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sahar/32/31475_2.png) [@Sahar](https://discourse.julialang.org/u/Sahar)
#### Post date: [December 14, 2021, 9:23pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching/73098/1 "2021-12-14T21:23:27Z")

</div>

Hello to everyone,  
I am quite new to julia language and could you please help me to figure it out, why I get this error ?

```julia
#Packages 
begin
	using Pkg
    PkgList = ["CSV", "DataFrames", "Ipopt", "JuMP", "Plots", "PlutoUI"]
    for p in PkgList
        if Base.find_package(p) == nothing
            Pkg.add(p)
        end
	end
	using JuMP, Ipopt, CSV, DataFrames, Plots, PlutoUI
end

#I read data from the file readData.jl
begin
	include("readData.jl")
    Sbase = 100e3 # VA
    Vbase = 11e3 # V
	BranchData, NodeData = readData("Branch_data_file.csv","Node_data_file.csv")
end

#If you want to see what is going on in the readData.jl, it would be as follows;

using CSV, DataFrames
function readData(BranchFile, NodesFile)
# Only one line of the code
        BranchData = CSV.read("E:/..../Branch_data_file.csv",DataFrame)
 
end

```

I almost checked everything, updated the packages(Jump), atom, and also checked the similar topics but still getting the error:

MethodError: no method matching readData(::String, ::String)  
Closest candidates are:  
readData(::Any, ::Any, !Matched::Any, !Matched::Any) at E:\Msc-Skoltech\Thesis\My code\readData.jl:3  
top-level scope at DA\_dispatch.jl:24  
eval at boot.jl:373 [inlined]

I hope I did not make a trivial mistake somewhere, but your help would be appreciated!

---

<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: [December 14, 2021, 11:19pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching/73098/2 "2021-12-14T23:19:56Z")

</div>

You are defining a function `readData` which takes four arguments and are calling it with two arguments?

---

<div class="post-metadata">

### Author: ![Sahar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sahar/32/31475_2.png) [@Sahar](https://discourse.julialang.org/u/Sahar)
#### Post date: [December 15, 2021, 12:01am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching/73098/3 "2021-12-15T00:01:55Z")

</div>

You are right. Yes, readData is a function with four arguments and two return values, and I did not notice that. Now the code is running well. Thank you.
