Mohamed Ayman
Mohamed Ayman

Reputation: 1

Virtualenv consumes high CPU on lubuntu OS

What I'm trying to do

Creating virtualenv with command

virtualenv -p python3.6 my_env_name

The env created successfully and runs, but the CPU usage goes above 80% and it stays there.

When I open the Task Manager I found Python3.6 has all the credits for the high consumption.

Note: This happens only on creation, so if I restarted my OS and activate the virtualenv everything is OK.

Things I tried to fix issue

The only worked two options

Demo for what is happening

The command

virtualenv -p python3.6 myenv

Returned message

created virtual environment CPython3.6.12.final.0-64 in 2214ms creator CPython3Posix(dest=/home/moh/Desktop/test_env/myenv, clear=False, global=False) seeder FromAppData(download=False, setuptools=bundle, wheel=bundle, pip=bundle, via=copy, app_data_dir=/home/moh/.local/share/virtualenv) added seed packages: pip==20.1.1, setuptools==47.3.1, wheel==0.34.2 activators XonshActivator,PowerShellActivator,CShellActivator,FishActivator,BashActivator,PythonActivator

Screenshot of my CPU usage

Lubunt CPU usage after create virtualenv

Upvotes: 0

Views: 416

Answers (1)

Mohamed Ayman
Mohamed Ayman

Reputation: 1

I found the solution on python documentation, here

Instead of:

virtualenv -p python3.6 myenv

Use:

python3.6 -m venv myenv

Kind Regards

Upvotes: 0

Related Questions