python安装时没有选path怎么办,Pythonpath仍然被忽略,无法通过pip在本地安装

在Ubuntu上使用Python 2.6时,遇到环境变量PYTHONPATH被忽略的问题,导致安装的numpy新版本无法被依赖包找到。尝试通过设置PYTHONPATH、使用setup.py的--prefix选项和编辑sys.path来解决,但系统级别的库仍然优先于个人安装的库。最终解决方案是创建个人site-packages目录,并使用pip的--user选项安装包到正确位置,同时解决权限问题,将脚本安装到$HOME/bin。
摘要由CSDN通过智能技术生成

I'm finding that my pythonpath environment variable is ignored. I'm using python 2.6 on ubuntu. I have in my .bashrc the following:

export PTYHONPATH=/my/home/mylibs/lib/python2.6/site-packages/:$PYTHONPATH

Then I install a new version of numpy using:

python setup.py install --prefix=/my/home/mylibs/

and it gets correctly installed locally. However, when I try to install other packages (also using setup.py) that depend on the new version of numpy, they cannot find it, because by default the loaded numpy is the one in /usr/llib, and not the one specified in my PYTHONPATH. My PYTHONPATH gets correctly set but the system-wide directory is still overruling it.

How can this be fixed? I just want my local version of numpy to be accessed when I do import numpy. I saw other posts related to this with python 2.4 but as far as I can tell it never got resol

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值