Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run the code in Python 3 #4

Open
chenQ1114 opened this issue Oct 17, 2019 · 0 comments
Open

Run the code in Python 3 #4

chenQ1114 opened this issue Oct 17, 2019 · 0 comments

Comments

@chenQ1114
Copy link

Hi

Is there any possible to run the whole codes in Python 3?

When I run the code of run_all.py, I import pickle instead of cPickle in Python 3 and got such error:

File "./preprocess.py", line 79, in
pickle.dump(dfTrain, f, -1)
_pickle.PicklingError: Can't pickle <function at 0x7f8a35868ae8>: attribute lookup on main failed
Traceback (most recent call last):
File "./genFeat_id_feat.py", line 36, in
dfTrain = pickle.load(f)
EOFError: Ran out of input
Traceback (most recent call last):
File "./genFeat_counting_feat.py", line 172, in
dfTrain = pickle.load(f)
EOFError: Ran out of input
Traceback (most recent call last):
File "./genFeat_distance_feat.py", line 236, in
dfTrain = pickle.load(f)
EOFError: Ran out of input

Then I import dill and use dill in the command of pickle.dump(dfTrain, f, -1) as :
dill.dump(dfTrain, f ,-1)

But I got the new error when import the load method

File "./genFeat_id_feat.py", line 36, in
dfTrain = pickle.load(f)
ModuleNotFoundError: No module named 'builtin'
Traceback (most recent call last):
File "./genFeat_counting_feat.py", line 176, in
skf = dill.load(f)
File "/home/mwp141/anaconda3/envs/chenQA/lib/python3.6/site-packages/dill/_dill.py", line 270, in load
return Unpickler(file, ignore=ignore, **kwds).load()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant