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: 'Process' object has no attribute 'set_cpu_affinity' #16

Closed
alphaprime opened this issue Mar 24, 2016 · 4 comments
Closed

Comments

@alphaprime
Copy link

On Ubuntu 14.04 LTS with Python 2.7.6, I have done the deepwalk installation. When I use
$deepwalk --input example_graphs/karate.adjlist --output karate.embeddings

it displays

Traceback (most recent call last): File "/usr/local/bin/deepwalk", line 9, in <module> load_entry_point('deepwalk==1.0.1', 'console_scripts', 'deepwalk')() File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point return ep.load() File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/usr/local/lib/python2.7/dist-packages/deepwalk-1.0.1-py2.7.egg/deepwalk/__main__.py", line 26, in <module> p.set_cpu_affinity(list(range(cpu_count()))) AttributeError: 'Process' object has no attribute 'set_cpu_affinity'

@GTmac
Copy link
Collaborator

GTmac commented Mar 25, 2016

This is a compatibility issue with psutil. In the file /usr/local/lib/python2.7/dist-packages/deepwalk-1.0.1-py2.7.egg/deepwalk/__main__.py, please change line 26 to:

try:
    p.set_cpu_affinity(list(range(cpu_count())))
except AttributeError:
    try:
        p.cpu_affinity(list(range(cpu_count())))
    except AttributeError:
        pass

Let me know if it works. Thanks!

@phanein phanein closed this as completed Apr 13, 2016
@Adarsh-kumar
Copy link

the same code is in my implementation as suggested by Gtmac still i am getting the same error.
what's next to try?

@DivyanshuSaxena
Copy link

I understand that this may be too late, but just for anyone who still faces this issue:- Make sure you make the change to the file main.py in the deepwalk/ directory, because when you run python setup.py install it copies this file at other build/ and bin/ directories

@iamxpy
Copy link

iamxpy commented Jul 23, 2020

the same code is in my implementation as suggested by Gtmac still i am getting the same error.
what's next to try?

Same here, the code in __main__.py is already the same as suggested, but the error is still raised. I also check that psutil is the latest version, didnt work. BTW, I am using python 3.6.

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

6 participants