安装atari,出现错误“self._handle = _dlopen(self._name, mode) OSError: [WinError 126] 找不到指定模块”

如题,安装过atari_py,但在import时出现"lib\ctypes\__init__.py", line 364, in __init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 126] 找不到指定的模块。"
在这里插入图片描述
打印了self.name,其值为D:\software\Anaconder3\envs\testrl\lib\site-packages\atari_py\ale_interface/ale_c.dll,我本地是存在这个dll文件的。
国内的帖子都不奏效,大部分是在说缺少.dll文件。国外的帖子https://github.com/openai/gym/issues/672,谈论的蛮激烈感觉不是我这个问题不是make相关。

最终解决:https://www.pythonf.cn/read/167592
卸载atari_py,重新安装atari_py==1.2.2,pip install --no-index -f https://github.com/Kojoley/atari-py/releases atari_py,有可能得添加信任(并取消代理),即pip install --no-index -f https://github.com/Kojoley/atari-py/releases atari_py --trusted-host github.com

而且必须从这个链接下载,如果直接安装pip install atari_py==1.2.2会报错
在这里插入图片描述

安装pytorch

pip install -f https://download.pytorch.org/whl/torch_stable.html torch1.7.0+cpu torchvision0.8.1+cpu torchaudio===0.7.0

使用过程中import torch出现ModuleNotFoundError: No module named '_ctypes'

解决:
命令行sudo apt-get install libffi-dev
之后重新生成安装文件(已虚拟环境中已安装的库不受影响),即cd Python-3.6.15 make && make install

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值