python - Conda showing two versions of requests library -
i'm new conda , seeing strange don't know if it's problem or not.
i'm in root environment. @ point trying install pip in environment, accidentally ran pip install requests. seems have installed in root environment:
$ conda list | grep requests requests 2.12.4 py36_0 requests 2.13.0 <pip> and looks pip version what's getting picked when run python:
$ python python 3.6.0 |continuum analytics, inc.| (default, dec 23 2016, 12:22:00) [gcc 4.4.7 20120313 (red hat 4.4.7-1)] on linux type "help", "copyright", "credits" or "license" more information. >>> import requests; requests.__version__ '2.13.0' my guess having 2 versions of same package lying around going cause headaches later. assumption i'd better off keeping non-pip version, tried this:
$ pip uninstall requests [asks confirmation, yes] $ conda list [traceback, can post if helpful. summary is:] modulenotfounderror: no module named 'requests' then pip install requests brings me square 1 (having both versions of requests).
finally, want know how prevent happening again. according docs, if want use pip install package in conda environment, should:
- activate conda environment want install package
- run
pip install whatever - it should show in
conda listcurrent environment.
however, isn't working me - installed package shows under conda list --name root rather in current environment.
so, handful of questions:
- is problem have 2 copies of
requestsin conda root? - if problem, how fix it?
- how use pip within conda environment?
- is problem have 2 copies of requests in conda root?
probably.
- if problem, how fix it?
in testing, conda remove followed pip uninstall trick. (after can re-install requests using conda time.) if goes wrong, remove .../lib/python3.6/site-packages/requests-2.13.0.dist-info. seemed work me.
fwiw, able reproduce double-install installing pip first, installing again conda.
- how use pip within conda environment?
your summary in op correct. activate conda environment , use pip would. rule of thumb install packages conda if available, , resort pip otherwise.
Comments
Post a Comment