2

I wanted to run my first python file on ubuntu when suddenly this message with no further instructions appeared:

Failed to create virtual env

As a consequence I have researched what the meaning of the error was. According to the forum this was the most appropriate solution:

discussion

I have tried it, however the same error message appeared. I also made sure that the location directory where I created my venv was empty. This is the furthest I have come:

Current selection

After this the same error message appears with no context how to solve it.

Edit:Error message

Solution: Unable to locate package python3-distutils in Ubuntu 16.04

First answer from ksharp

Markus Reiter
  • 41
  • 1
  • 4
  • Contact PyCharm support at pycharm-support@jetbrains.com and send them `idea.log` from **Help | Show Log in ...**. Other than that - try creating a venv from the terminal - with e.g. `python3.9 -mvenv ...` - does it work? – Pavel Karateev Sep 05 '21 at 18:36
  • Hi i am new to ubuntu, wanted to know how to detect idea.log, only thing I have found to detect log files was cat /var/log/syslog – Markus Reiter Sep 06 '21 at 12:22
  • That's PyCharm log, see the top menu (File, Edit, View, ..., Help) on your screenshot - select Help and "Show Log in" option there to open the folder with logs. – Pavel Karateev Sep 06 '21 at 18:41
  • Thank you, i just sent the e-mail. In case you are familiar with the error i have attached it to the question. – Markus Reiter Sep 08 '21 at 12:41
  • 2
    Seems like there is no `distutils` package installed. Try `sudo apt-get install python3.9-distutils`. – Pavel Karateev Sep 08 '21 at 13:50
  • Thank you, it almost worked perfectly I just had to add -extra. I found the solution on a different post >> attached above – Markus Reiter Sep 09 '21 at 07:37

1 Answers1

1

I had a similar issue in Linux Mint, the solution which helped me was found on code2care.org, which I also mentioned here:

You need to update virtualenv package! Run the below command in CMD or Mac/Linux terminal,

pip upgrade virtualenv

If you have pip3, try the below command,

pip3 upgrade virtualenv

If you are using conda, try the below command,

conda install virtualenv

First, I installed pip3 and then proceeded to pip3 install virtualenv.

Error404
  • 6,920
  • 1
  • 26
  • 50
chodeng
  • 11
  • 1
  • I think you might have omitted the `install` portion of the command. e.g. `pip3 install --upgrade virtualenv` – alphazwest Mar 02 '22 at 22:55