Hello i'm trying to run an odoo project and everytime i try to run it i get the following error
ImportError: No module named 'psutil'
i have tried to run
import psutil
via command line and it gives me also this error i'm using odoo 11
and python 3.5
i have tried the following commands to install the package
sudo apt-get install python3-dev
also
sudo apt-get install python3-psutil
and for sure
sudo pip3 install psutil
and it supposed to be installed now as when i run the last command again it gives me this message
Requirement already satisfied: psutil in /usr/local/lib/python3.5/dist-packages (5.4.5)
but when i run the odoo project it gives me the error
thanks
I don't know if this is the same problem (I am working on a vanilla Ubuntu 16.04), but I was getting a similar frustrating message around psutil
. The problem seemed to be that it was installed in my Python 2.7 version, and pip
was only looking at that version, seemingly ignoring the fact that my current virtual environment was Python 3.5.
I noticed pip3
did nothing, so I installed pip3
with apt-get install python3-pip
. Then I could could successfully use pip3 install psutil
to install into the correct Python3.5 and my virtual directory.
What I am puzzled by is how I got so far without hitting this earlier. I have installed lots of things over the last few months with pip
and they seemingly went into both versions (side-by-side Python2.7 and Python3.5 environments for running TensorFlow). Why is it different for psutil
?
But it works now.
Perhaps these steps might fix your problem.
Change the Python3 default version in Ubuntu
From the comment:
sudo update-alternatives --config python
Will show you an error:
update-alternatives: error: no alternatives for python3
You need to update your update-alternatives
, then you will be able to set your default python version.
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
Then run :
sudo update-alternatives --config python
Set python3.6
as default.
Or use the following command to set python3.6 as default:
sudo update-alternatives --set python /usr/bin/python3.6
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.