Wrong pip in conda env

jul

I have a conda env called birdid.

While working in the env (i.e. I did source activate bird_dev), showing the list of the packages give

(bird_dev)...$ conda list
# packages in environment at /home/jul/Development/miniconda/envs/bird_dev:
#
...
pep8                      1.6.2                    py27_0  
pip                       7.1.2                    py27_0  
pixman                    0.26.2                        0  
...

but when trying to see what pip is used I get

(bird_dev)...$ which pip
/usr/local/bin/pip

while the correct python is found

(bird_dev)...$ which python
/home/jul/Development/miniconda/envs/bird_dev/bin/python

Anybody can help?

Edit: more details about the installed versions

Check which -a pip

(bird_dev)...$ which -a pip
/usr/local/bin/pip
/usr/bin/pip

The version in /usr/bin/pip is quite old.

(bird_dev)...$ /usr/bin/pip -V
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)    
(bird_dev)....$ /usr/local/bin/pip -V
pip 6.1.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)

There is actually no pip in the env

$ ll /home/jul/Development/miniconda/envs/bird_dev/bin/ | grep pip

returns nothing

there is one pip in /home/jul/Development/miniconda/bin/pip

$ /home/jul/Development/miniconda/bin/pip -V
pip 6.1.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)

but it is not the version listed by conda list, and it is a python script (!)

$ cat /home/jul/Development/miniconda/bin/pip
#!/home/jul/Development/miniconda/bin/python
if __name__ == '__main__':
    import sys
    from pip import main

    sys.exit(main())

Edit: echo $PATH

(bird_dev)...$ echo $PATH
/home/jul/Development/miniconda/envs/bird_dev/bin:/home/jul/torch/install/bin:/home/jul/torch/install/bin:/home/jul/torch/install/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Edit: try to force install

(bird_dev)...$ conda install --force pip
Fetching package metadata: ....
Solving package specifications: .
Package plan for installation in environment /home/jul/Development/miniconda/envs/bird_dev:

The following packages will be UPDATED:

    pip: 7.1.2-py27_0 --> 7.1.2-py27_0

Proceed ([y]/n)? y

[      COMPLETE      ]|##################################################################################################################################################################################| 100%
Extracting packages ...
[      COMPLETE      ]|##################################################################################################################################################################################| 100%
Unlinking packages ...
[      COMPLETE      ]|##################################################################################################################################################################################| 100%
Linking packages ...
[      COMPLETE      ]|##################################################################################################################################################################################| 100%
(bird_dev)...$ which pip
/home/jul/Development/miniconda/envs/bird_dev/bin/pip
(bird_dev)...$ /home/jul/Development/miniconda/envs/bird_dev/bin/pip -V
pip 6.1.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
(bird_dev)...$ cat /home/jul/Development/miniconda/envs/bird_dev/bin/pip 
#!/home/jul/Development/miniconda/envs/bird_dev/bin/python
if __name__ == '__main__':
    import sys
    from pip import main

    sys.exit(main())

Weird.

asmeurer

You probably have PYTHONPATH set. I would recommend unsetting it, and removing any lines from ~/.bashrc that set it. It will cause any of your conda environments' Pythons to look in that location before themselves.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Tox installs the wrong version of pip to it's virtual env

From Dev

pip executes the wrong python library versions inside virtual env

From Dev

Tox installs the wrong version of pip to it's virtual env

From Dev

conda env create failed?

From Dev

Pip Package not available in conda

From Dev

How to replace pip with conda?

From Java

What is the difference between pip and conda?

From Java

Pip Package not being recognized in Conda

From Dev

Practical difference between pip and conda

From Dev

What is the difference between pip and conda?

From Dev

pip vs conda in anaconda enviroment

From Dev

What is the difference between pip and conda?

From Dev

Changing path of pip to Virtual Env

From Dev

Unable to pip inside virtual env

From Dev

Installing Python Package to Conda Env Without Using Conda

From Java

Python - Activate conda env through shell script

From Dev

Packages from Conda env not found in Jupyer Notebook

From Dev

Conda env activation: Weird "must be sourced" error

From Dev

uWSGI with conda env keeps failing (Docker)

From Dev

How do I activate a conda env in a subshell?

From Dev

Python - Activate conda env through shell script

From Dev

Conda env not loading correct version of numpy

From Dev

Pycharm autocomplete doesn't work in conda env

From Java

How to update jupyterlab using conda or pip?

From Dev

pip install vs. conda install

From Java

Zsh: Conda/Pip installs command not found

From Dev

Installing shapefile / shapelib not found via conda or pip

From Dev

Why there are pip and conda packages after fresh installation?

From Dev

Exporting a conda environment with local pip installs

Related Related

HotTag

Archive