When I am adding new functions to a file I can't import them neither if I just run the script in terminal or if I launch ipython
and try importing a function there. I have no .pyc
files. It looks as if there is some kind of caching going on. I never actually faced such an issue even though have been working with various projects for a while. Why could it happen?
What I see is the following: I launch ipython
and the functions that were written long time ago by other programmers can be imported fine. If I comment them out and save the file, they still can be imported without any issues. If I write new functions they can't be imported.
The directory is git
directory, I cloned the repo. Then the new branch was created and I switched to it. Python version is 3.7.5
, and I am working with virtual environment that I created some time ago which I activated with source activate py37
.
I don't know whether its important but I have an empty __init__.py
in the folder where script is located.
The code (I don't think its relevant, but still):
import hail as hl
import os
class SeqrDataValidationError(Exception):
pass
# Get public properties of a class
def public_class_props(cls):
return {k: v for k, v in cls.__dict__.items() if k[:1] != '_'}
def hello():
print('hello')
public_class_props
is an old function and can be imported, but hello
- can't.