Good morning!
I'm using a code (with python 3.8) that is running both in a local PC and in a ssh server. In one point, I'm loading data from a pickle using the next piece of code:
from os.path import exists
import _pickle as pickle
def load_pickle(pickle_file):
if exists(pickle_file):
with open(pickle_file, 'rb') as f:
loaded_dic = pickle.load(f)
return loaded_dic
else:
return 'Pickle not found'
pickle_file
is a string with the path of the pickle. If the pickle exists, the function returns a dictionary, while if it doesn't exist, it returns the string 'Pickle not found'.
In my local PC, the code works perfectly, loading the dict without problems. However, in the ssh server, theoretically, the dict is loaded, but, if I try to access to it, jus typing loaded_dic
, it throws the following error:
AttributeError: 'NoneType' object has no attribute 'axes'
Due to it, the rest of my code fails when it try to use the variable loaded_dic
.
Thank you very much in advance!