Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error installing ipdb for Python 2.7 using virtualenv and pip

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)

like image 251
Alexander Fedotov Avatar asked May 14 '17 14:05

Alexander Fedotov


People also ask

What is IPDB in Python?

ipdb exports functions to access the IPython debugger, which features tab completion, syntax highlighting, better tracebacks, better introspection with the same interface as the pdb module. Example usage: import ipdb ipdb. set_trace() ipdb.

What is PIP install setup?

PIP is a package management system used to install and manage software packages written in Python. It stands for “preferred installer program” or “Pip Installs Packages.” PIP for Python is a utility to manage PyPI package installations from the command line.


2 Answers

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

$ pip install ipdb==0.10.2
like image 179
Alexander Fedotov Avatar answered Oct 01 '22 13:10

Alexander Fedotov


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.

like image 24
suroh Avatar answered Oct 01 '22 11:10

suroh