一旦确定conda中的pip版本后,不要使用 python -m pip install --upgrade pip 命令更新pip版本!!!!会造成版本冲突,从而不能打包!!!

1、创建conda虚拟环境并初始化

conda create -n paddleNLP_v2.5 python=3.7 pip=22.3.1

2、先下载安装paddle(后面再安装paddlenlp会容易点)

python -m pip install paddlepaddle==2.4.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

3、安装paddlenlp(根据github上的最新版)

pip install --pre --upgrade paddlenlp -f https://www.paddlepaddle.org.cn/whl/paddlenlp.html

4、安装jupyter,依次执行以下命令:

pip install lxml -i https://pypi.tuna.tsinghua.edu.cn/simple/

pip install nbconvert==7.3.1 -i https://pypi.tuna.tsinghua.edu.cn/simple/

pip install jupyter -i https://pypi.tuna.tsinghua.edu.cn/simple/

5、安装jupyter扩展包

pip install jupyter_contrib_nbextensions -i https://pypi.tuna.tsinghua.edu.cn/simple/

安装完毕后,在命令行执行(安装关联的 JavaScript 和 CSS 文件):

jupyter contrib nbextension install --user

关于jupyter的使用技巧,参考:https://mp.weixin.qq.com/s/bVdmdVRJkteIui7ULlGZVQ

6、安装jupyterlab

pip install jupyterlab -i https://pypi.tuna.tsinghua.edu.cn/simple/

安装成功后,访问jupyter notebook的链接,端口号后面加 /lab 即可访问jupyterlab,比如 :8888/lab

7、在conda虚拟环境中的命令行中输入 jupyter notebook即可启动

对于notebook密码的问题,参考https://blog.csdn.net/nikita_zj/article/details/117230173

jupyter notebook --generate-config

相关链接

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: