Conflict issues of pip install in virtual environment

问题描述

conda create -n py3.7 python=3.7 anaconda
conda activate py3.7
pip freeze #show global packages
pip install pytesseract #installed in root environment: ~/anaconda3/lib/python3.7/site-packages/
conda list # no pytesseract installed

 

Ref:https://github.com/ContinuumIO/anaconda-issues/issues/1429

 

原因:创建py3.7时未安装pip,系统默认使用global pip

 

解决方法:在virtual env下安装pip,并重新激活env

conda activate py3.7
conda install -n py3.7 pip
conda deactivate
conda activate py3.7
pip type # show local packages
pip install pytesseract #installed in local environment: ~/anaconda3/envs/py3.7/lib/python3.7/site-packages

 

posted @ 2020-04-20 18:30  Sherrrry  阅读(185)  评论(0编辑  收藏  举报