http://pypi.python.org/pypi/simplejson/2.0.9
I've tried a few variations of the syntax below, but it always seems
to install the newest version (v2.5.0). I don't know if this is an
issue with simplejson, how I'm using pip, or something else. Based on
the below, can anyone say why it's not working and how to correct the
behavior?
Thanks,
--Chris
> sudo pip freeze -E /opt/local/bin/python
nose==1.1.2
> sudo pip install -E /opt/local/bin/python 'simplejson<2.1.0'
Downloading/unpacking simplejson<2.1.0
Running setup.py egg_info for package simplejson
Installing collected packages: simplejson
Running setup.py install for simplejson
File "/opt/local/lib/python2.4/site-packages/simplejson/encoder.py",
line 398
if (not _bigint_as_string or
^
SyntaxError: invalid syntax
Successfully installed simplejson
Cleaning up...
> sudo pip freeze -E /opt/local/bin/python
nose==1.1.2
simplejson==2.5.0
> python -V
Python 2.4.6
> which python
/opt/local/bin/python
> which pip
/usr/local/bin/pip
_______________________________________________
Distutils-SIG maillist - Distut...@python.org
http://mail.python.org/mailman/listinfo/distutils-sig
I can't replicate this; when I "pip install 'simplejson<2.1.0'" I get
2.0.9. The most likely cause is if you have a build/ directory in your
current working dir with an already-unpacked simplejson 2.5.0 in it;
there's a known bug in pip that causes it to not check the version if it
finds an already-unpacked source.
Also, you may want to be aware that the -E flag is deprecated and is
already removed in the latest pip release (1.1) because it does not
handle isolated virtualenvs correctly. Instead, create a virtualenv and
use the pip that is automatically installed inside it (virtualenv
path/to/venv && path/to/venv/bin/pip install simplejson).
Carl
Thanks, Carl. Good intuition! That was the case for me. Thanks also
for the information regarding -E and virtualenv. I will start using
that approach.
--Chris
>
> Also, you may want to be aware that the -E flag is deprecated and is
> already removed in the latest pip release (1.1) because it does not
> handle isolated virtualenvs correctly. Instead, create a virtualenv and
> use the pip that is automatically installed inside it (virtualenv
> path/to/venv && path/to/venv/bin/pip install simplejson).
>
> Carl
>
>