当前位置: 首页 > news >正文

hui怎么做网站qq交流群怎么升级会员

hui怎么做网站,qq交流群怎么升级会员,如何做微信小程序网站,drupal 网站实例1#xff0c;背景#xff1a; 最近在学习langchain的课程#xff0c;里面创建自己的知识库的Retrieval模块中#xff0c;需要用到向量数据库。 所以按照官方的教程#xff08;vectorstores#xff09;#xff0c;准备使用chroma的向量数据库。图片来源 2#xff0c;问…1背景 最近在学习langchain的课程里面创建自己的知识库的Retrieval模块中需要用到向量数据库。 所以按照官方的教程vectorstores准备使用chroma的向量数据库。图片来源 2问题1pip安装出错 现象 第一步安装python包的时候出现了下面的错误 pip install chromadb Looking in indexes: https://mirror.baidu.com/pypi/simple/, https://mirrors.aliyun.com/pypi/simple/, https://pypi.tuna.tsinghua.edu.cn/simple/ Collecting chromadbDownloading https://mirrors.aliyun.com/pypi/packages/7c/cc/8b822be150323492e1d3c2ae46ccd99ddc9841894afdc41c408ffd68918e/chromadb-0.4.22-py3-none-any.whl (509 kB) ...... Collecting importlib-metadata7.0,6.0 (from opentelemetry-api1.2.0-chromadb)Downloading https://mirrors.aliyun.com/pypi/packages/59/9b/ecce94952ab5ea74c31dcf9ccf78ccd484eebebef06019bf8cb579ab4519/importlib_metadata-6.11.0-py3-none-any.whl (23 kB) Installing collected packages: pypika, mpmath, monotonic, mmh3, flatbuffers, wrapt, websocket-client, uvloop, urllib3, tomli, sympy, python-dotenv, pyasn1, pulsar-client, overrides, opentelemetry-util-http, opentelemetry-semantic-conventions, opentelemetry-proto, oauthlib, importlib-metadata, humanfriendly, httptools, grpcio, googleapis-common-protos, chroma-hnswlib, bcrypt, backoff, asgiref, watchfiles, rsa, pyproject_hooks, pyasn1-modules, opentelemetry-exporter-otlp-proto-common, deprecated, coloredlogs, requests-oauthlib, posthog, opentelemetry-api, onnxruntime, google-auth, build, tokenizers, opentelemetry-sdk, opentelemetry-instrumentation, kubernetes, opentelemetry-instrumentation-asgi, opentelemetry-exporter-otlp-proto-grpc, opentelemetry-instrumentation-fastapi, chromadbAttempting uninstall: urllib3Found existing installation: urllib3 2.0.7Uninstalling urllib3-2.0.7:Successfully uninstalled urllib3-2.0.7Attempting uninstall: importlib-metadataFound existing installation: importlib-metadata 7.0.1Uninstalling importlib-metadata-7.0.1: ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: RECORD Consider using the --user option or check the permissions. 原因分析 看上面的红色的部分安装的时候要求importlib-metadata的版本6.0版本7但是环境中默认的是7.0.1所以安装的时候想要把7的版本卸载安装6的版本问题出在卸载这里没有权限卸载。 为什么没有权限卸载我用的是百度平台的BML codeLab创建ipynb文件的时候选择的内核如下所以环境自带了python3的环境。这个包是python的一个标准库importlib-metadata)猜测可能是作为python环境的一部分 codeLab这边不允许修改。 解决方案 按照出错中的提示上图出错的黄色的部分 使用user模式进行python包的安装正常安装成功。 !pip install --user chromadb 补充 我有点好奇使用这个--user和没有使用有啥区别 后来发现两者的位置不同。 没有--user的时候安装到默认的python包的路径下面。 可以用pip show pkname找一个有的包查看python包的安装路径 codelab中默认的路径是/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages有--user的时候安装到用户的目录下面 通过pip show pkname的命令查看--user模式安装好的包的路径。 codelab中对应的--user模式下的路径是 /home/aistudio/.local/lib/python3.10/site-packages 3问题2导入模块失败ModuleNotFoundError : No module named chromadb 现象 上面安装之后正准备开开心心继续的时候发现虽然安装成功使用pip show能够正常看到包的信息但是使用Langchain生成数据库的实例的时候会报错 原因是在langchain中引入chromadb的模块时候提示模块不存在。(import chromadb失败 # 定义一个向量数据库的实例 vectorDB Chroma(         collection_namelangchain_store,         embedding_functionqianfan_embedding_model) 原因分析 python导包的时候会查找内置模块以及sys.path中的路径。 确认一下sys.path的设定里面是没有上面安装的本地用户的路径的 所以虽然包正常安装但是import的时候找不到所以报错。   import sys print(sys.path) [/home/aistudio, /opt/conda/envs/python35-paddle120-env/lib/python310.zip, /opt/conda/envs/python35-paddle120-env/lib/python3.10, /opt/conda/envs/python35-paddle120-env/lib/python3.10/lib-dynload, , /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages] 解决方案 把--user模式下的安装路径加入到sys.path中。 不同的环境下安装的路径可能有所不同使用命令[pip show 包名] 查看安装的路径。 sys.path.append(/home/aistudio/.local/lib/python3.10/site-packages) 之后就可以正常import了。 4后记 这个问题搞了一上午整体来看对于pip安装的细节比如安装路径以及安装之后import导入的细节包是怎么查找的不是特别清楚导致调查花了一些时间。 mark一下也希望分享给有类似问题的小伙伴。
http://www.pierceye.com/news/901524/

相关文章:

  • 制作企业网站的实训报告防伪码查询网站怎么做的
  • 做网站会很忙吗网站 js 广告代码
  • 没有网站域名备案专业做书画推广的网站
  • 做app网站公司名称有没有做黑市网站
  • apache建设网站做网站页面代码
  • html5 单页网站网络运维从入门到精通
  • 联合建设官方网站银川网站seo
  • jsp网站开发与设计摘要网站开发是什么
  • 公司网站建设论文结束语谷歌建站多少钱
  • 陕西省建设工会网站漳州做网站最便宜
  • asp网站怎么做301定向辽宁网络优化方法
  • 足球网站建设无锡企业网站的建设
  • 网站建设 国风网络学校网站建设新闻
  • 网站集成微信登录ai logo设计网站
  • 给客户做网站kesioncms企业网站蓝色模板
  • 哪个网站可以做视频播放器建筑工程网络计划方法
  • 长沙做网站的有哪些wordpress投稿页面路径怎么写
  • 京东第一次做网站如何做像淘宝一样的网站
  • 南湖网站建设公司怎么用iapp做网站软件
  • 永康网站建设专业公司六安网约车收入怎么样
  • 长沙品质企业建站服务电话随州公司做网站
  • 怎么做期货网站永久免费linux服务器
  • 怎么访问被禁止的网站微信商城网站方案
  • 建设网站需要会什么简单网页代码html
  • 南通网站怎么推广淘客选品网站开发
  • 网站开发的风险与风险管理网站名字
  • 朝阳网站视频拍摄脚本
  • 嘉兴建站模板源码郑州网站开发的公司电话
  • 新乡网站开发的公司电话百度热搜风云榜
  • 福永网站的建设福州