首页 > 其他分享 >import旧版本的scanpy1.8是TypeError

import旧版本的scanpy1.8是TypeError

时间:2024-06-02 20:30:14浏览次数:12  
标签:scanpy1.8 conda matplotlib scanpy install 旧版本 import 报错 pandas

为了能将scanpy的h5ad文件和seurat的sce文件互相转换,因为有些包只能在R里使用,所以得使用scdior,,这要控制scanpy的版本,我选择了scanpy1.8.1,官网还要控制seurat的版本

但是出现报错,如下

TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

先把matplotlib降到3.7版本以下,我选的是3.6,conda实际安装的是3.6.2

然后就又报错了SystemError: initialization of _internal failed without raising an exception

conda install numpy=1.23.5

然后这个会把matplotlib、scanpy也删除

这里再重新安装scanpy和 matplotlib

conda install -c conda-forge scanpy=1.8.1

然后又报错ImportError: cannot import name 'is_categorical' from 'pandas.api.types' (/share/home/dddd/.conda/envs/scdiopy/lib/python3.8/site-packages/pandas/api/types/__init__.py)

查找原因,发现

移除原来的pandas,这一步会同时移除matplotlib base以及scanpy

安装pandas=1.5.3

为何是1.5.3而不是1.9呢

因为

所以 conda install pandas=1.5.3

再按照上面的重新安装matplotlib以及scanpy

总之,scanpy=1.8.1需要pandas=1.5.3,numpy=1.23.5,matplotlib=3.6.2

现在就不报错了

但是读取h5ad文件出错AnnDataReadError: Above error raised while reading key '/layers' of type <class 'h5py._hl.group.Group'> from /.

这里需要升级anndata到0.8.0

conda install anndata=0.8.0 -c conda-forge

然后还报错是h5py的版本问题

pip install h5py==2.10.0

找到了一个scanpy=1.8.2的相关依赖包的CSDN博客,可以参考

https://blog.csdn.net/qq_52813185/article/details/128422965

最后安装diopy

pip install diopy

标签:scanpy1.8,conda,matplotlib,scanpy,install,旧版本,import,报错,pandas
From: https://blog.csdn.net/aydayUP111/article/details/139393007

相关文章

  • css44 CSS The !important Rule
    https://www.w3schools.com/css/css_important.asp Whatis!important?The!importantruleinCSSisusedtoaddmoreimportancetoaproperty/valuethannormal.Infact,ifyouusethe!importantrule,itwilloverrideALLpreviousstylingrulesforthat......
  • const filePath = fileURLToPath(new URL('plopfile.js', import.meta.url)); 解释一
    这段代码的作用是获取当前文件所在目录下的plopfile.js文件的绝对路径。这里是逐步解释:import.meta.url:这是ESModules中的一个元属性,它提供了当前模块的绝对URL。在Node.js环境中,当你在一个模块文件中访问import.meta.url时,它会返回该模块文件的文件系统路径转换成的URL格......
  • go tool compile 报错 could not import sync (file not found)
    前言Go版本:$goversiongoversiongo1.21.4darwin/amd64我想对go文件进行反汇编,然后就报错了:$gotoolcompile-Srace.gorace.go:3:8:couldnotimportsync(filenotfound)我就惊讶了一下,标准库怎么还能找不到呢?难道是我GOROOT配置错了?发现了问题原因原......
  • golang import 导入的四种方式
     1标准导入:import"package_name" 2导入别名:import(alias"package_name") 3匿名导入:import(_"package_name") 4点导入:import(."package_name") 下面做详细解释:Go语言最常见的导入方式是标准导入,格式如下:import&qu......
  • django import_export 可视化导入导出外键字段
    在Django中使用django-import-export库进行外键关系的数据导入时,可以通过自定义资源类来处理外键字段的解析和保存。这样可以使导入过程更加直观和有效。我们将展示如何配置和使用django-import-export库,以便在导入数据时正确处理外键关系并将其从可读形式(如名称)转换为模型......
  • web前端之vue动态访问静态资源、静态资源的动态访问、打包、public、import、URL、Vit
    MENU静态资源与打包规则动态访问静态资源直接导入将静态资存放在public目录中动态导入URL构造函数结束语实践与坑附文静态资源与打包规则介绍Vite脚手架在打包代码的时候,会把源代码里对于静态资源的访问路径转换为打包后静态资源文件的路径。主要的区别是文件指纹......
  • from selenium import webdriver
    url='https://chat18.aichatos8.com'chrome_binary_path='/Users/baidu/project/script/chromedriver/chrome-mac-arm64/GoogleChromeforTesting.app/Contents/MacOS/GoogleChromeforTesting'chromedriver_path='/Users/baidu/project/s......
  • react eslint import { useUserStore } from "@/stores/user"; 找不到模块“@/stores/
    报错解释:这个报错通常意味着React项目中的ESLint配置不能正确识别@别名指向的目录。在JavaScript模块中,通常使用@作为特定包的别名,例如@/stores/user可能是一个指向特定stores/user模块的别名。ESLint用于代码质量和代码风格的检查,当它不能正确解析这个别名时,就会报出“找不到模......
  • vue3插件(unplugin-auto-import自动引入的使用)
    1. vite.config文件里面1importAutoImportfrom'unplugin-auto-import/vite'23plugins:[4.......,5AutoImport({6include:[7/\.[tj]sx?$/,//.ts,.tsx,.js,.jsx8/\.vue$/,9/\.vue\?......
  • Windows10 子系统 WSL 位置迁移问题_wsl --import 未指定的错误
    CSDN搬家失败,手动导出markdown后再导入博客园最近想体验下世界上最好的Linux发行版Win10(bushi),拿来深度学习炼丹,所以参考了在WSL2中使用CUDA提到的方法安装。列举下遇到的问题:1Windows预览版本没响应按理说在设置-更新和安全-Windows预览体验计划里面注册后,就......