1

so i have a fresh debian install. I installed pythons 3.5,3.6,3.7:

root@m2:~# apt-get install python3.{5,6,7}-dev

and try to set up some virtualenvs:

for i in 5 6 7 ; do dir=venv3.$i; echo $dir; mkdir $dir; virtualenv $dir --python=python3.$i; done

result:

-------------
venv3.5
Running virtualenv with interpreter /usr/bin/python3.5
Using base prefix '/usr'
New python executable in /root/venv3.5/bin/python3.5
Also creating executable in /root/venv3.5/bin/python
Installing setuptools, pip, wheel...done.
-------------
venv3.6
Running virtualenv with interpreter /usr/bin/python3.6
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 25, in <module>
    import distutils.spawn
ModuleNotFoundError: No module named 'distutils.spawn'
-------------
venv3.7
Running virtualenv with interpreter /usr/bin/python3.7
Using base prefix '/usr'
/usr/local/lib/python2.7/dist-packages/virtualenv.py:1047: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
New python executable in /root/venv3.7/bin/python3.7
Also creating executable in /root/venv3.7/bin/python
Installing setuptools, pip, wheel...done.

any idea how to fix this for python 3.6?

the exact version is:

root@m2:~# dpkg-query -s python3.6
Package: python3.6
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 326
Maintainer: Matthias Klose <doko@debian.org>
Architecture: amd64
Multi-Arch: allowed
Version: 3.6.8-1

Meanwhile, on some older system I also have debian 8 and python3.6, and there it works ok:

root@m1:~# dpkg-query -s python3.6
Package: python3.6
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 315
Maintainer: Matthias Klose <doko@debian.org>
Architecture: amd64
Multi-Arch: allowed
Version: 3.6.6-4

root@m1:~# virtualenv venv3.6 --python=python3.6
Running virtualenv with interpreter /usr/bin/python3.6
Using base prefix '/usr'
New python executable in /root/venv3.6/bin/python3.6
Also creating executable in /root/venv3.6/bin/python
Installing setuptools, pip, wheel...
done.
  • Any specific reason you are creating three virtual env's at once? – Raju Devidas Jan 9 at 19:33
  • Well I just need the one with py36. But I wasnt able to do it, I wanted to check what's wrong. Now I presume, that this is some problem with python3.6 from debian repo – murison Jan 9 at 20:12
  • Well, the issue is present in upstream, I was having similar issues creating a virtualenv. The upstream codebase for virtualenv is having bugs which might have got carried in Debian repos. Take a look at github.com/pypa/pipenv/issues/2871 – Raju Devidas Jan 10 at 11:41
  • I filed a bug under debian: bugs.debian.org/cgi-bin/bugreport.cgi?bug=918881 – murison Jan 10 at 16:48

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.