Don't include directory in Python 3.6 with virtualenv

I am creating two virtual environments called "venv35" and "venv36" for Python 3.5 and 3.6 respectively. The "include" subdirectory is not in "venv36", so "Python.h" cannot be found in this environment (Python 3.6). Any ideas about this?

$ virtualenv -p python3.5 venv35
$ virtualenv -p python3.6 venv36
$ ls -la venv35 venv36
venv35:
total 28
 .
 ..
 bin
 include
 lib
 pip-selfcheck.json
 share

venv36:
total 24
 .
 ..
 bin
 lib
 pip-selfcheck.json
 share

      

+3


source to share


2 answers


If the virtual environment is created with "venv", we get:

$ /usr/bin/python3.6 -m venv py36
$ ls -la py36/
total 32
.
..
bin
include
lib
lib64 -> lib
pip-selfcheck.json
pyvenv.cfg
share

      



The include folder is still empty, so the solution seems to be creating a symbolic link to the original location of the include folder.

ln -s /usr/include/python3.6/ py36/include/python3.6

      

+1


source


You may need to set headers for Python 3.6:



sudo apt install python3.6-dev

      

0


source







All Articles