Error installing ipdb for Python 2.7 using virtualenv and pip
Asked Answered
S

3

8

When I tried to install ipdb, I had the following problem:

$ pip install ipdb
Collecting ipdb
  Using cached ipdb-0.10.3.tar.gz
    Complete output from command python setup.py egg_info:
    error in ipdb setup command: Invalid environment marker: python_version >= "3.3"

How can I install ipdb in the simplest way?

(I use macOS Sierra 10.12.4, virtualenv 1.11.6, python 2.7.10, pip 9.0.1)

Sarcomatosis answered 14/5, 2017 at 14:33 Comment(0)
S
9

My problem was solved by installing a previous version of ipdb:

$ pip install ipdb==0.10.2
Sarcomatosis answered 14/5, 2017 at 14:33 Comment(4)
You could have also updated your Python version as the error message stays.Buckie
to version 3? It can be work-intensive for existing project. But did ipdb stop support 2.7? pypi.python.org/pypi/ipdb - this page does not say anything about thisSarcomatosis
If you look at my answer you will see that ipdb 0.10.3 does work with python 2.7; If you want to upgrade that package python -m pip uninstall ipdb ; then run python2 -m pip install ipdb. It should work fine...Rania
I know this is an old thread. But I noticed your comment about switching between 2.7 and 3+ being work intensive. You’re quite right however python 2 is going to die in a couple of years and most major libraries are porting their modules to have compatibility with 3+ and many have even pledged to drop python 2.7 support entirely. You may want to change over now while it’s still relatively easy.Rania
R
4

I see your answer, and it's valid I'd also like to add a little bit more.

  1. The issue had occurred because you're using python 2.7 and the most recent version of ipdb has packages that require python 3+.

Instead of specifying a version you could do the following

python2 -m pip install ipdb

Most times you can do this and your version will be recognized and the apropriate packages will be installed (Ie, what's compatible).

Though this isn't always the case it works more often than not.

pip install ipdb==0.10.2 

Is also acceptable as you're specifying the version number of the package its self. I will however point out that in this case you can use 0.10.3 with python 2.7; it's installed and works fine for me. There were packages related to ipdb that required higher versions of python but had checks put in place to install other versions which were compatible with both python 2.7. and the latest version of ipdb. enter image description here

update:

Even the official documentation says it's supported. Maybe you're missing something that wasn't pulled? check the requirements to verify everything was installed right.

It's likely when you installed it the first time (when it originally failed) the required packages that were also brought in were for the wrong version.

In which case you'd need to remove them as well as it would be trying to used the cached versions of them instead of pulling the appropriate ones. Or at least that's a possibility.

Rania answered 14/5, 2017 at 14:49 Comment(3)
Unfortunately, python2 -m pip install ipdb gives the same error in my caseSarcomatosis
Even the official documentation says it's supported. Maybe you're missing something that wasn't pulled? check the requirements to verify everything was installed right. It's likely when you installed it the first time the required packages that were also brought were for the wrong version in which case you'd need to remove them as well as it would be trying to used the cached versions of them instead of pulling the appropriate ones.Rania
I also find this strange. I tried earlier versions of pip - the same result. Perhaps, the reason is virtualenv. With system python 2.7 installation of ipdb is successfulSarcomatosis
S
0

I just replicated your problem myself (although fwiw I was using Python 3.5). pip install -U ipdb failed with exactly the same error you reported.

What worked for me was to explicitly upgrade ipython first (pip install -U ipython, although perhaps in your case it needs to be installed for the first time). Then ipdb (re)installed just fine.

Simonetta answered 23/5, 2017 at 18:51 Comment(2)
This didn't work for me. I tried ipython==5.4 and ipdb failed with the same error.Dygall
I'm running a Debian 8.2.0 vagrant box with Python 3.4 and pip 9.0.1 installed, and had the same issue: $ python3 --version Python 3.4.2 $ python3 -m pip install ipdb Collecting ipdb Using cached ipdb-0.10.3.tar.gz Complete output from command python setup.py egg_info: error in ipdb setup command: Invalid environment marker: python_version >= "3.3" ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-1rix8nqv/ipdb/ pip-installing ipython pulled in ipdb automatically without problems.Miculek

© 2022 - 2024 — McMap. All rights reserved.