欢迎光临!
若无相欠,怎会相见

我在实际中遇到的一些问题及解决办法

序言

寒假太冷,导致我很少开机。但是,今天是二月份最后一天,不能在二月份不写一篇文章啊,可是又没有什么可写。于是就只能写一些之前我遇到的一些问题及解决办法。

LiveCD安装系统

刚放假的时候,折腾一段时间的grub2安装系统,其中我在安装LiveCD系统的时候,有一点问题。

其实吧,主要还是我自己的问题,因为之前我安装的Fedora系统的磁盘分区管理选择的是LVM,然后重装的时候就懵逼了。LVM是 Logical Volume Manager(逻辑卷管理)的缩写。经过摸索,我最后的处理过程如下:

[root@localhost-live liveuser]# pvremove /dev/sda12
  Can't open /dev/sda12 exclusively.  Mounted filesystem?
[root@localhost-live liveuser]# vgremove fedora
Do you really want to remove volume group "fedora" containing 3 logical volumes? [y/n]: y
  Logical volume "root" successfully removed
  Logical volume "home" successfully removed
  Logical volume fedora/swap in use.
[root@localhost-live liveuser]# pvscan
  PV /dev/sda12   VG fedora          lvm2 [<110.21 GiB / 106.00 GiB free]
  PV /dev/sda9    VG centos          lvm2 [70.00 GiB / 4.00 MiB free]
  Total: 2 [180.21 GiB] / in use: 2 [180.21 GiB] / in no VG: 0 [0   ]
[root@localhost-live liveuser]# vgremove -f fedora
  Logical volume fedora/swap in use.
[root@localhost-live liveuser]# pvscan
  PV /dev/sda12   VG fedora          lvm2 [<110.21 GiB / 106.00 GiB free]
  PV /dev/sda9    VG centos          lvm2 [70.00 GiB / 4.00 MiB free]
  Total: 2 [180.21 GiB] / in use: 2 [180.21 GiB] / in no VG: 0 [0   ]
[root@localhost-live liveuser]# pvremove /dev/sda12
  Can't open /dev/sda12 exclusively.  Mounted filesystem?
[root@localhost-live liveuser]#

Anaconda安装

由于毕设的原因,我选择安装Anaconda,但是还是出现了小问题。

我是直接下载的 .sh 安装程序,结果出现这个问题。

bash: ./Anaconda2-5.0.1-Linux-x86_64.sh: Permission denied

解决办法为: chmod u+x *.sh ,*.sh改为文件名。

将anaconda环境变量添加到系统中。

export PATH=/home/Liangz/anaconda2/bin:$PATH

地址取决于你自己。然后更新环境变量。

source ~/.bashrc

之后运行anaconda-navigator,结果报错。

[root@bogon Liangz]# anaconda-navigator
No protocol specified
QXcbConnection: Could not connect to display :0
Aborted (核心已转储)

然后执行 ps -aux 查看运行的所有的程序,记下与anaconda-navigator相关的PID,执行kill -9 PID ,之后执行conda install anaconda-navigator 重新安装anaconda-navigator,在终端中运行anaconda-navigator就有图形界面了。

毕设相关

我在模拟自己的一个项目的时候,我以为直接使用 pip install 就可以完整安装了依赖的模块,可惜,我在最新的Fedora27上安装模块的时候直接就报错了。执行命令:pip install -i https://pypi.douban.com/simple -r requirements.txt

Running setup.py bdist_wheel for subprocess32 ... error
Failed building wheel for subprocess32
Complete output from command /home/Liangz/anaconda2/envs/opencv-project/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-HsGeC0/subprocess32/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-FQt7ix-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    copying subprocess32.py -> build/lib.linux-x86_64-2.7
    running build_ext
    building '_posixsubprocess' extension
    creating build/temp.linux-x86_64-2.7
    gcc -pthread -B /home/Liangz/anaconda2/envs/opencv-project/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/Liangz/anaconda2/envs/opencv-project/include/python2.7 -c _posixsubprocess.c -o build/temp.linux-x86_64-2.7/_posixsubprocess.o
    unable to execute 'gcc': No such file or directory
    error: command 'gcc' failed with exit status 1

阅读上面的记录可以知道是subprocess32模块没有安装成功,再看最下面,才知道是gcc的原因。

上网查找资料,解决办法是:

sudo yum -y install gcc gcc-c++ kernel-devel

sudo yum -y install python-devel libxslt-devel libffi-devel openssl-devel

然后在重新执行:pip install -i https://pypi.douban.com/simple -r requirements.txt ,最后的结果是:Successfully installed PyWavelets-0.5.2 backports.functools-lru-cache-1.4 backports.weakref-1.0rc1 bleach-1.5.0 cycler-0.10.0 funcsigs-1.0.2 html5lib-0.9999999 markdown-2.2.0 matplotlib-2.1.1 mock-2.0.0 networkx-2.0 pbr-3.1.1 protobuf-3.5.0.post1 pyparsing-2.2.0 scikit-image-0.13.0 scikit-learn-0.18.1 scipy-0.19.0 sk-video-1.1.8 sklearn-0.0 subprocess32-3.2.7 tensorflow-1.2.0 tensorflow-gpu-1.2.0 werkzeug-0.13 。

以上只是个人拙见,如有错误,敬请指出,感谢阅读!      —2018-02-28  22:48:40

赞(0) 打赏
转载请注明:飘零博客 » 我在实际中遇到的一些问题及解决办法
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

欢迎光临