R. Ilma
R. Ilma

Reputation: 186

Not include directory in Python 3.6 with virtualenv

I am creating two virtual environments named as "venv35" and "venv36" for Python 3.5 and 3.6, respectively. The sub-directory "include" is missing in "venv36", thus "Python.h" cannot found at this environment (Python 3.6). Any ideas about it?

$ 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

Upvotes: 10

Views: 3941

Answers (2)

R. Ilma
R. Ilma

Reputation: 186

If a 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 the creation of a symbolic link to the original "include" folder location.

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

Upvotes: 4

Adam Byrtek
Adam Byrtek

Reputation: 12202

You might need to install the headers for Python 3.6:

sudo apt install python3.6-dev

Upvotes: 2

Related Questions