I can’t install some packages on virtualenv because of this error.

I tried to install:

pip install pyups==0.4.4


pip install --upgrade distribute

and they give me the error:

Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-tLx1oC/distribute/setup.py", line 58, in <module>
      File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      File "setuptools/command/egg_info.py", line 177, in run
        writer = ep.load(installer=installer)
      File "pkg_resources.py", line 2241, in load
        if require: self.require(env, installer)
      File "pkg_resources.py", line 2254, in require
      File "pkg_resources.py", line 2471, in requires
        dm = self._dep_map
      File "pkg_resources.py", line 2682, in _dep_map
        self.__dep_map = self._compute_dependencies()
      File "pkg_resources.py", line 2699, in _compute_dependencies
        from _markerlib import compile as compile_marker
    ImportError: No module named _markerlib

I tried also to install markerlib with

pip install markerlib

But the error continues.

$ easy_install distribute

or build from source works for me

I try the following command

easy_install distribute
pip install --upgrade distribute

which works.

install setuptools:

wget https://pypi.python.org/packages/source/s/setuptools/setuptools-19.2.zip
unzip setuptools-19.2.zip
cd setuptools-19.2
python setup.py install

Although the virtualenv docs says --distribute and --setuptools options are now legacy, when I created the environment with :

virtualenv myenv --distribute

the error was gone.

This sound silly. But It works for me. I am using ubuntu. While Installing virtualenv through apt-get install I faced problems. But I got working with pip install virtualenv.

sudo pip uninstall virtualenv

sudo apt-get purge python-virtualenv

sudo pip install virtualenv