pip在anaconda环境下指定安装路径的安装问题

错误起因:

pip安装torchtext==0.1.1完成后,发现安装路径为.local/lib/python3.6/site-packages,但是我的程序需要使用python2.7。

一次改正:

指定pip安装路径重新安装$ pip install --user --install-option="-prefix=./.local/lib/python2.7" torchtext==0.1.1 

安装不成功

/users4/zsun/anaconda3/lib/python3.6/site-packages/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
  cmdoptions.check_install_build_global(options)
Requirement already satisfied: torchtext==0.1.1 in /users4/zsun/.local/lib/python3.6/site-packages
Requirement already satisfied: requests in /users4/zsun/anaconda3/lib/python3.6/site-packages (from torchtext==0.1.1)
Requirement already satisfied: tqdm in /users4/zsun/.local/lib/python3.6/site-packages (from torchtext==0.1.1)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /users4/zsun/anaconda3/lib/python3.6/site-packages (from requests->torchtext==0.1.1)
Requirement already satisfied: idna<2.7,>=2.5 in /users4/zsun/anaconda3/lib/python3.6/site-packages (from requests->torchtext==0.1.1)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /users4/zsun/anaconda3/lib/python3.6/site-packages (from requests->torchtext==0.1.1)
Requirement already satisfied: certifi>=2017.4.17 in /users4/zsun/anaconda3/lib/python3.6/site-packages (from requests->torchtext==0.1.1)

发现安装不成功 ,并可发现/anaconda3/lib/python3.6/site-packages/pip/commands/install.py为pip的安装目录。

我的anaconda是基于python3安装的,所以接下来

二次改正:

为我的anacoda添加python2 的环境,操作流程http://www.lqkweb.com/blog.php?id=86

安装好py27之后,source activate py27开启py27。(关闭:deactivate

此时find -name python2.7发现除了必须有的./.local/lib/python2.7还出现众多类似于./anaconda3/envs/py27/bin/python2.7的。

下一步重新尝试$ pip install --user --install-option="-prefix=./anaconda3/envs/py27/lib/python2.7" torchtext==0.1.1

安装成功。

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值