python venv jenkins_请教 jenkins 在构建时激活 venv 失败

在本地pycharm中可以使用. venv/bin/activate直接激活虚拟环境,用docker搭了jenkins,在上面构建的时候提示虚拟环境没有激活成功,一开始以为docker环境的问题,进入dokcer内部找到workspace,直接执行. venv/bin/activate能激活成功,然后就没有头绪了,问了一下度娘也似乎没有找到合适的答案,恳请各位大佬能帮忙看下问题出在哪里?

pycharm截图:

docker截图:

jenkins截图:

Started by user jeremy

Running as SYSTEM

Building on master in workspace /var/jenkins_home/workspace/xueqiu_test

using credential 0fc2244d-1609-4664-9b49-dcaf67ad2210

git rev-parse --is-inside-work-tree # timeout=10

Fetching changes from the remote Git repository

git config remote.origin.url https://github.com/jeremy8250/Appium-Hogwarts.git # timeout=10

Fetching upstream changes from https://github.com/jeremy8250/Appium-Hogwarts.git

git --version # timeout=10

using GIT_ASKPASS to set credentials github account

git fetch --tags --progress -- https://github.com/jeremy8250/Appium-Hogwarts.git +refs/heads/:refs/remotes/origin/ # timeout=10

git rev-parse refs/remotes/origin/master{commit} # timeout=10

git rev-parse refs/remotes/origin/origin/master{commit} # timeout=10

Checking out Revision da900d10f0bcfa906afb34a946908c3ed2352134 (refs/remotes/origin/master)

git config core.sparsecheckout # timeout=10

git checkout -f da900d10f0bcfa906afb34a946908c3ed2352134 # timeout=10

Commit message: "移动data.yaml到项目根目录下"

git rev-list --no-walk da900d10f0bcfa906afb34a946908c3ed2352134 # timeout=10

[xueqiu_test] $ /bin/sh -xe /tmp/jenkins4564481353202604200.sh

+ . venv/bin/activate

+ deactivate nondestructive

[ -n ]

[ -n ]

[ -n -o -n ]

[ -n ]

unset VIRTUAL_ENV

[ ! nondestructive = nondestructive ]

VIRTUAL_ENV=/Users/ouchou/Projects/Appium-Hogwarts/venv

export VIRTUAL_ENV

_OLD_VIRTUAL_PATH=/usr/local/openjdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

PATH=/Users/ouchou/Projects/Appium-Hogwarts/venv/bin:/usr/local/openjdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

export PATH

[ -n ]

[ -z ]

_OLD_VIRTUAL_PS1=$

[ x(venv) != x ]

PS1=(venv) $

export PS1

[ -n -o -n ]

+ which python

/usr/bin/python

Finished: SUCCESS

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值