Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using Ubuntu server 12.04. The default python version is 2.7. I have installed python 3.3 in /opt directory. When I try to create a virtualenv to use python 3.3, I get the following error:

$virtualenv -p /opt/python3.3/bin/python3 python3_env

Running virtualenv with interpreter /opt/python3.3/bin/python3 Traceback (most recent call last): File "usr/lib/python2.7/dist-packages/virtualenv.py", line 17, in import zlib ImportError: No module named 'zlib'

How do I resolve this?

share|improve this question
add comment

1 Answer 1

First of all, I would recommend using deadsnakes ppa How to install Python 3.3?

What you need to understand is your virtualenv package should be compatible with python3. I.e.virtualenv should be installed with python3.3. This can be done with easy_install OR pip compatible with python3.3.

Or

Also python3.3 comes with inbuilt virtualenv which can be used as

python3.3 -m venv VIRTUAL_ENV_NAME

pyvenv VIRTUAL_ENV_NAME

These binaries may be in /opt. So you may require full path.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.