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

AttributeError: 'function' object has no attribute 'func_code' #3

Closed
hungpham2017 opened this issue Jul 19, 2018 · 4 comments
Closed

Comments

@hungpham2017
Copy link

I ran the 01-parallel_krhf-diamond.py example and got this error:

Traceback (most recent call last):
File "01-parallel_krhf-diamond.py", line 34, in
mf.with_df = df.FFTDF(cell, kpts)
File "/panfs/roc/groups/6/gagliard/phamx494/mpi4pyscf/tools/mpi.py", line 498, in init
(args[0].dumps(),)+args[1:], kwargs))
File "/panfs/roc/groups/6/gagliard/phamx494/mpi4pyscf/tools/mpi_pool.py", line 133, in apply
F = _function_wrapper(function)
File "/panfs/roc/groups/6/gagliard/phamx494/mpi4pyscf/tools/mpi_pool.py", line 171, in init
self.func_code = marshal.dumps(function.func_code)
AttributeError: 'function' object has no attribute 'func_code'

sunqm added a commit that referenced this issue Jul 19, 2018
@sunqm
Copy link
Collaborator

sunqm commented Jul 19, 2018

This is a python 3 compatibility issue. The attribute .func_code of python2 was replaced by python 3 .code attribute.

@sunqm sunqm closed this as completed Jul 19, 2018
@danielsjf
Copy link

danielsjf commented Dec 6, 2019

.__code__ to be precise

@RiaanLab
Copy link

@danielsjf Thanks, there is a huge difference between the two.

@babaralishah
Copy link

Hi!

HEre is my code and error below:
please assist...
image

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

5 participants