AttributeError: module 'psutil' has no attribute 'Process'
najibveto opened this issue · comments
hello,
I installed gget using the command:
pip install --upgrade gget
then when i tried to install alphafold using the command:
gget setup alphafold
I got the following error:
gget setup alphafold
Traceback (most recent call last):
File "/home/najib/miniconda3/bin/gget", line 5, in <module>
from gget.main import main
File "/home/najib/miniconda3/lib/python3.9/site-packages/gget/__init__.py", line 10, in <module>
from .gget_alphafold import alphafold
File "/home/najib/miniconda3/lib/python3.9/site-packages/gget/gget_alphafold.py", line 31, in <module>
from ipywidgets import GridspecLayout
File "/home/najib/miniconda3/lib/python3.9/site-packages/ipywidgets/__init__.py", line 25, in <module>
from .widgets import *
File "/home/najib/miniconda3/lib/python3.9/site-packages/ipywidgets/widgets/__init__.py", line 4, in <module>
from .widget import Widget, CallbackDispatcher, register, widget_serialization
File "/home/najib/miniconda3/lib/python3.9/site-packages/ipywidgets/widgets/widget.py", line 13, in <module>
from ipykernel.comm import Comm
File "/home/najib/miniconda3/lib/python3.9/site-packages/ipykernel/comm/__init__.py", line 3, in <module>
from .comm import Comm
File "/home/najib/miniconda3/lib/python3.9/site-packages/ipykernel/comm/comm.py", line 14, in <module>
from ipykernel.kernelbase import Kernel
File "/home/najib/miniconda3/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 70, in <module>
class Kernel(SingletonConfigurable):
File "/home/najib/miniconda3/lib/python3.9/site-packages/ipykernel/kernelbase.py", line 79, in Kernel
processes: t.Dict[str, psutil.Process] = {}
AttributeError: module 'psutil' has no attribute 'Process'
i uninstalled the psutil and installed again, i got the same error.
what is the possible solution?
thank you.
Hi, thanks for reaching out. I have not encountered this error before. My first recommendation would indeed be to reinstall psutil using something like pip3 install --ignore-installed psutil
. Could you please tell me which version of gget and psutil you currently have installed?
thank you for your reply.
i checked the version for gget and it is 0.27.2 and for psutill and it is 5.9.4.
i tried to reinstall psutil using
pip3 install --ignore-installed psutil
and then run:
gget setup alphafold
and i got the folllowing message:
gget setup alphafold
Mon Jan 9 11:25:55 2023 INFO openmm v7.5.1 already installed.
Mon Jan 9 11:25:55 2023 INFO Installing AlphaFold from source (requires pip and git).
Mon Jan 9 11:26:36 2023 INFO AlphaFold installed succesfully.
Mon Jan 9 11:26:36 2023 INFO Installing pdbfixer from source (requires pip and git).
Note: switching to '1d3306581269fc2fa54aa94a034d476fda86cbee'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/home/najib/miniconda3/lib/python3.9/site-packages/numpy-1.22.3.dist-info/METADATA'
Mon Jan 9 11:26:37 2023 ERROR pdbfixer installation failed.
It looks like the psutil issue was fixed. It seems like there are some issues with other packages in your environment. I would recommend trying the following:
First, reinstall/update numpy since the issue might be coming from numpy (pip install -U numpy
).
If that doesn’t fix the issue, I would recommend restarting in a fresh Python environment (conda environments manual).
Alternatively, check out this solution. It might help fix the issue in the current environment.
It looks like the psutil issue was fixed. It seems like there are some issues with other packages in your environment. I would recommend trying the following: First, reinstall/update numpy since the issue might be coming from numpy (
pip install -U numpy
).If that doesn’t fix the issue, I would recommend restarting in a fresh Python environment (conda environments manual).
Alternatively, check out this solution. It might help fix the issue in the current environment.
hello,
thank you for your suggestion.
i did as your suggestion and reinstall numpy and it is wokring fine.
thanks a lot.
Great! :)