# Import from a file in current directory using PyCall

**URL:** <https://discourse.julialang.org/t/import-from-a-file-in-current-directory-using-pycall/90287>\
**Category:** General Usage\
**Tags:** pycall\
**Created:** [November 15, 2022, 12:58pm UTC](https://discourse.julialang.org/t/import-from-a-file-in-current-directory-using-pycall/90287 "2022-11-15T12:58:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nvenkov1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nvenkov1/32/43679_2.png) [@nvenkov1](https://discourse.julialang.org/u/nvenkov1)\
**Post date:** [November 15, 2022, 12:58pm UTC](https://discourse.julialang.org/t/import-from-a-file-in-current-directory-using-pycall/90287/1 "2022-11-15T12:58:48Z")

</div>

I run Julia from a folder which contains a Python file called GramSchmidt.py which I wish to import from using PyCall. I proceed as follows:

```julia
using PyCall
GramSchmidt = pyimport("GramSchmidt")

```

I however get an error that says ModuleNotFoundError("No module named ‘GramSchmidt’ "). How should I proceed to be able to import from a file in my current directory with pyimport?

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [November 15, 2022, 1:33pm UTC](https://discourse.julialang.org/t/import-from-a-file-in-current-directory-using-pycall/90287/2 "2022-11-15T13:33:16Z")

</div>

The is explained in the [PyCall README](https://github.com/JuliaPy/PyCall.jl#troubleshooting).

---

<div class="post-metadata">

**Author:** ![nvenkov1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nvenkov1/32/43679_2.png) [@nvenkov1](https://discourse.julialang.org/u/nvenkov1)\
**Post date:** [November 15, 2022, 1:38pm UTC](https://discourse.julialang.org/t/import-from-a-file-in-current-directory-using-pycall/90287/3 "2022-11-15T13:38:26Z")

</div>

Okay. Thanks. So the solution is

```julia
using PyCall
pushfirst!(pyimport("sys")."path", "");
GramSchmidt = pyimport("GramSchmidt");

```
