实验室linux服务器安装gym出现的问题

编程入门 行业动态 更新时间:2024-10-25 12:21:45

<a href=https://www.elefans.com/category/jswz/34/1768150.html style=实验室linux服务器安装gym出现的问题"/>

实验室linux服务器安装gym出现的问题

1.1 conda install gym[all]

出现错误:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.PackagesNotFoundError: The following packages are not available from current channels:- gymCurrent channels:-                     search for alternate channels that may provide the conda package you're
looking for, navigate to use the search bar at the top of the page.

之前只有清华源,后来加了阿里云和中科大,同样还是找不到gym包

1.2 直接从anaconda下载


该文章提出三种解决方法:
第二种:conda install -c conda-forge gym-all
得到同样的错误

第三种直接从anaconda下载,再进行安装,根据环境(linux-64, python=3.8.3)选择安装包

测试gym

conda list

import gym
env = gym.make('CartPole-v1')
for i_episode in range(20):observation = env.reset()for t in range(100):env.render()print(observation)action = env.action_space.sample()observation, reward, done, info = env.step(action)if done:print("Episode finished after {} timesteps".format(t+1))break

出现错误:

Traceback (most recent call last):File "test.py", line 2, in <module>env = gym.make('CartPole-v1')
AttributeError: module 'gym' has no attribute 'make'

1.3 AttributeError: module ‘gym’ has no attribute ‘make’

这是因为我把git下载的Gym文件夹和test.py放一个目录下,当我移除gym文件夹后,gym模块便不存在了

(zhu_pytorch) [new402@~]$python zhu_xw/test.py
Traceback (most recent call last):File "zhu_xw/test.py", line 1, in <module>import gym
ModuleNotFoundError: No module named 'gym'

2. pip install gym[all]

ERROR: Could not find a version that satisfies the requirement gym[all] (from versions: none)
ERROR: No matching distribution found for gym[all]

.html
该文章提出了将Git下载的gym文件夹复制到linux中再安装

git clone .git
#进入 gym 文件夹:
cd gym
pip install -e .[all]

出现错误

ERROR: Command errored out with exit status 1:command: /home/new402/anaconda3/envs/zhu_pytorch/bin/python /home/new402/anaconda3/envs/zhu_pytorch/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-vx48f_zn/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i 'https://pypi.tuna.tsinghua.edu/simple/' --trusted-host pypi.douban -- 'setuptools>=40.8.0' wheelcwd: None

简中并没有解决这个问题的帖子,类似问题的解决方法也解决不了。

2.1 安装依赖项

参考文章:

sudo apt-get install -y cmake zlib1g-dev libjpeg-dev xvfb xorg-dev python-opengl libboost-all-dev libsdl2-dev swig

出现错误:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package cmake is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another sourceE: Package 'cmake' has no installation candidate
E: Unable to locate package zlib1g-dev
E: Unable to locate package libjpeg-dev
E: Unable to locate package xvfb
E: Unable to locate package xorg-dev
E: Unable to locate package python-opengl
E: Unable to locate package libboost-all-dev
E: Unable to locate package libsdl2-dev
E: Unable to locate package swig

跟1.1同样的缺包问题

参考:.html

解决方法如下:
# apt-get update
# apt-get upgrade
# apt-get install <packagename>
这样就可以正常使用apt-get了~

出现错误

$apt-get update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)

参考:

缺包问题另一篇文章提出不同看法()

表示这个问题的原因是ubuntu的/etc/apt/source.list中的源比较旧了,需要更新一下,更新方法:

sudo apt-get update

出现问题

$sudo apt-get update
Get:1  focal InRelease [3,190 B]
Get:2  focal-security InRelease [3,190 B]
Get:3  focal-updates InRelease [3,190 B]
Get:4  focal-proposed InRelease [3,190 B]
Get:5  focal-backports InRelease [3,190 B]
Err:1  focal InReleaseClearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Err:2  focal-security InReleaseClearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Err:3  focal-updates InReleaseClearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Err:4  focal-proposed InReleaseClearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Err:5  focal-backports InReleaseClearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Reading package lists... Done
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository ' focal InRelease' is not signed.
E: Failed to fetch   Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository ' focal-security InRelease' is not signed.
E: Failed to fetch   Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository ' focal-updates InRelease' is not signed.
E: Failed to fetch   Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch   Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository ' focal-proposed InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch   Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository ' focal-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
2.1.1 更新源

参考:

第一步,在官网源,我的版本是9.4.0

cat /proc/versionLinux version 5.15.0-48-generic (buildd@lcy02-amd64-043) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.   0, GNU ld (GNU Binutils for Ubuntu) 2.34) 


实验室给的服务器版本太老了,连网页都给出警告

第二步,用vim替换原有的source.list的内容

sudo vim /etc/apt/sources.list

第三步,更新:sudo apt-get update,仍然有错误

sudo apt-get update
Ign:1  jaunty InRelease
Ign:2  jaunty-security InRelease
Ign:3  jaunty-updates InRelease
Ign:4  jaunty-backports InRelease
Err:5  jaunty ReleaseCertificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.certificate does not match the expected.  Could not handshake: Error in the certificate verification.10 443]
Err:6  jaunty-security ReleaseCertificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.certificate does not match the expected.  Could not handshake: Error in the certificate verification.10 443]
Err:7  jaunty-updates ReleaseCertificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.certificate does not match the expected.  Could not handshake: Error in the certificate verification.10 443]
Err:8  jaunty-backports ReleaseCertificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.certificate does not match the expected.  Could not handshake: Error in the certificate verification.10 443]
Reading package lists... Done
E: The repository ' jaunty Release' does not ha.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository ' jaunty-security Release' doease file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository ' jaunty-updates Release' doease file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository ' jaunty-backports Release' dlease file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
2.1.2 安装ca-certificates

参考:

$sudo apt install ca-certificates
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates is already the newest version (20211016~20.04.1).
The following packages were automatically installed and are no longer required:g++-8 javascript-common libaccinj64-10.1 libcublas10 libcublaslt10 libcudart10.1 libcufft10libcufftw10 libcuinj64-10.1 libcupti-dev libcupti-doc libcupti10.1 libcurand10 libcusolver10libcusolvermg10 libcusparse10 libegl-dev libgl-dev libgl1-mesa-dev libgles-dev libgles1libglvnd-dev libglx-dev libjs-jquery libjs-underscore libncurses5 libnppc10 libnppial10libnppicc10 libnppicom10 libnppidei10 libnppif10 libnppig10 libnppim10 libnppist10 libnppisu10libnppitc10 libnpps10 libnvblas10 libnvgraph10 libnvidia-ml-dev libnvjpeg10 libnvrtc10.1libnvtoolsext1 libnvvm3 libopengl-dev libstdc++-8-dev libthrust-dev libtinfo5 libvdpau-devnode-html5shiv nsight-compute nsight-systems ocl-icd-opencl-dev opencl-c-headers
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

安装成功

2.1.3 继续sudo apt-get update

仍然出错:

Get:1 http://202.204.48.82/1.htm?mv6=2001:0da8:0208:0125:ac18:4098:bd8e:346b&url= jaunty InRelease [3,190 B]
Err:1 http://202.204.48.82/1.htm?mv6=2001:0da8:0208:0125:ac18:4098:bd8e:346b&url= jaunty InReleaseClearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:2 http://202.204.48.82/1.htm?mv6=2001:0da8:0208:0125:ac18:4098:bd8e:346b&url= jaunty-security InRelease [3,190 B]
Err:2 http://202.204.48.82/1.htm?mv6=2001:0da8:0208:0125:ac18:4098:bd8e:346b&url= jaunty-security InReleaseClearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:3 http://202.204.48.82/1.htm?mv6=2001:0da8:0208:0125:ac18:4098:bd8e:346b&url= jaunty-updates InRelease [3,190 B]
Err:3 http://202.204.48.82/1.htm?mv6=2001:0da8:0208:0125:ac18:4098:bd8e:346b&url= jaunty-updates InReleaseClearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:4 http://202.204.48.82/1.htm?mv6=2001:0da8:0208:0125:ac18:4098:bd8e:346b&url= jaunty-backports InRelease [3,190 B]
Err:4 http://202.204.48.82/1.htm?mv6=2001:0da8:0208:0125:ac18:4098:bd8e:346b&url= jaunty-backports InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Reading package lists... Done
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository ' jaunty InRelease' is noned.
E: Failed to fetch  rsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository ' jaunty-security InReleas not signed.
E: Failed to fetch   Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch   Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository ' jaunty-updates InReleas not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch   Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository ' jaunty-backports InReleis not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

解决方法众说纷纭,莫衷一是
有改DNS
未完待续…

2.2 安装mujoco

参考文章:

cd ~
mkdir .mujoco
wget .zip
unzip mjpro150_linux.zip

在第三步下载出错:

ERROR: cannot verify www.roboti.us's certificate, issued by ‘C=CN,O=Doctorcom LTD.,CN=demotest.doctorcom’:Self-signed certificate encountered.ERROR: certificate common name ‘demotest.doctorcom’ doesn't match requested host name ‘www.roboti.us’.
To connect to www.roboti.us insecurely, use `--no-check-certificate'.

于是直接下载到windows解压再复制到服务器里,放在.mujoco下

把如下内容添加到 .bashrc 文件中(参考)

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro150/bin:/usr/local/cuda-10.2/lib64
export MUJOCO_KEY_PATH=~/.mujoco:~/.mujoco/mjpro150/bin:$MUJOCO_KEY_PATH

验证一下安装的正确性

cd ~/.mujoco/mjpro150/bin
./simulate

报错

[new402@~/.mujoco/mjpro150/bin]$./simulate
./simulate: error while loading shared libraries: libmujoco150.so: cannot open shared object file: No such file or directory

需source ~/.bashrc使.bashrc 文件生效再验证

2.2.1 安装mujoco-py

下载好对应的150版本的文件

wget .50.1.0.tar.gz

按照GitHub上说的,安装好必备的一些包

sudo apt install libosmesa6-dev libgl1-mesa-glx libglfw3

出现错误

$sudo apt install libosmesa6-dev libgl1-mesa-glx libglfw3sudo apt install libosmesa6-dev libgl1-mesa-glx libglfw3
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libgl1-mesa-glx is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another sourceE: Unable to locate package libosmesa6-dev
E: Package 'libgl1-mesa-glx' has no installation candidate
E: Unable to locate package libglfw3sudo
E: Unable to locate package install
E: Unable to locate package libosmesa6-dev
E: Package 'libgl1-mesa-glx' has no installation candidate
E: Unable to locate package libglfw3

与2.1同样的问题

更多推荐

实验室linux服务器安装gym出现的问题

本文发布于:2024-03-06 10:14:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1715068.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:实验室   服务器   linux   gym

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!