2 Replies - 2000 Views - Last Post: 13 January 2013 - 10:52 AM Rate Topic: -----

#1 Orochimaru  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 47
  • Joined: 26-December 12

ImportError: No module named zlib + Virtualenv.py

Posted 12 January 2013 - 08:22 AM

Virtualenv.py complains even after I have installed the zlib development packages, restarted the terminal and rebooted the computer. What is going on with Mint14? Because I'm following the exact same setup instructions as when I was using Debian Squeeze.
linux@Mint14:~/usr-32$ sudo apt-get install zlib1g-dev
linux@Mint14:~/usr-32$ sudo apt-get install zlib1g-dbg


ENV2 - Doesn't work with downloaded Python source codes. :(/>
linux@Mint14 ~/usr-32 $ python virtualenv.py --verbose --python=/home/linux/usr-32/py-2.4.6/bin/python2.4 /home/linux/.virtualenvs/ENV2_py24

Running virtualenv with interpreter /home/linux/usr-32/py-2.4.6/bin/python2.4

Traceback (most recent call last):
  File "virtualenv.py", line 17, in ?
    import zlib
ImportError: No module named zlib




ENV1 - But it doesn't complain when using the built-in Python version. Why is this?
linux@Mint14 ~/usr-32 $ python virtualenv.py --verbose --python=/usr/bin/python /home/linux/.virtualenvs/ENV1_py27



Is This A Good Question/Topic? 0
  • +

Replies To: ImportError: No module named zlib + Virtualenv.py

#2 Nallo  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 163
  • View blog
  • Posts: 255
  • Joined: 19-July 09

Re: ImportError: No module named zlib + Virtualenv.py

Posted 12 January 2013 - 04:46 PM

Counter question: Your built-in python version is 2.7 but you want to use 2.4.x?

Not entirely sure that what I am saying now is correct:
Doesn't seem a virtualenv problem. To use zlib python has to be compiled with zlib activated. In python 2.5 it was deactivated by default (so probably also for 2.4). Maybe you need to compile python 2.4 yourself with zlib activated.
Was This Post Helpful? 1
  • +
  • -

#3 Orochimaru  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 47
  • Joined: 26-December 12

Re: ImportError: No module named zlib + Virtualenv.py

Posted 13 January 2013 - 10:52 AM

View PostNallo, on 13 January 2013 - 12:46 AM, said:

Counter question: Your built-in python version is 2.7 but you want to use 2.4.x?

As a Python newbie and newbie programmer I've disovered that the Django tutorials are written differently for different Django versions. Which forces the reader to have a specific Python version on their computer.
I was on Debian before which uses a much older Python version than Ubuntu and Mint.

Then I discovered that most shared webhosts also uses older Python versions. I trust my webhost's services more than I do some other shared webhosts that offers a better Python experience. So I'm reluctant to switch webhost.

So I guess my answer to your counter question: Is that I'm trying to prepare myself for the future when Python 2.7 gets old and everybody uses Python 3. Except for webhosts and companies who are still stuck with using older Python versions.

I want the power of choice, therefore I'm doing what may seem crazy to the common man. :wheelchair:/>



View PostNallo, on 13 January 2013 - 12:46 AM, said:

Not entirely sure that what I am saying now is correct:
Doesn't seem a virtualenv problem. To use zlib python has to be compiled with zlib activated. In python 2.5 it was deactivated by default (so probably also for 2.4). Maybe you need to compile python 2.4 yourself with zlib activated.

Yes you were correct I had to enable zlib library in "~/usr-32/Python-2.4.6/Modules/Setup" to solve this specific problem.



However as I continued my fight against all the remaining errors thrown at me I finally hit the wall. So it seems like I'm not able to pip install 'django==1.3' anymore, or don't have to deal with Django 1.3 anymore. One less problem to care about in the future perhaps.

source: https://groups.googl...env/R15_V7ugI4w

Quote

Pip 1.2 dropped support for Python 2.4; the minimum supported Python
version is now Python 2.5. This is mentioned in the changelog [1] and in
the release announcement on this list.

Carl



Anyhow problem seems to be solved now! Python 2.4 no longer fully supported.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1