0

I am trying to install virtual environment on my Ubuntu and my python is 3.5. My command is:

python3 -m venv my-env/ 

It reminds me to install python3-venv first, but then got the following error.

apt-get install python3-venv
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-venv is already the newest version (3.5.1-3).
0 upgraded, 0 newly installed, 0 to remove and 95 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Setting up cython3 (0.23.4-0ubuntu5) ...
Traceback (most recent call last):
  File "/usr/bin/py3compile", line 34, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
ImportError: No module named 'debpython'
dpkg: error processing package cython3 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 cython3
E: Sub-process /usr/bin/dpkg returned an error code (1)

Is this because Python3.5 doesn't work with python3 -m venv? If I can't upgrade python3.5, what can I do?

loki
  • 976
  • 1
  • 10
  • 22
ling
  • 1,555
  • 3
  • 18
  • 24

1 Answers1

0
  1. You can't use apt-get install without root/sudo. Yeah you can jump through hoops but ignoring that.
  2. You can use anaconda-python without root. That would be a separate python from the system one with likely a different version. And that's a subject for another question
  3. Your locales are messed up
  4. Yeah the error mesg could be better

Added later

Why venv is absent from builtin-python I'm not clear; it's supposed to be there 3.3 onwards

Pip is alternative to apt and by default works for user — sudo not required. You can get pip by hand but it's fiddly and ill-advised

However the pip module should work even if the command is not available ie use python3 -m pip where you were using just pip

Community
  • 1
  • 1
Rusi
  • 1,054
  • 10
  • 21