新聞中心
Linux如何安undle

Bundle是一個(gè)用于管理Ruby應(yīng)用程序所需的庫和依賴項(xiàng)的工具。它的安裝過程實(shí)際上相當(dāng)簡單,只需要幾個(gè)簡單的步驟就可以了。在本文中,我們將討論Linux如何安undle的過程。
安裝Ruby
在安undle之前,你需要確保你已經(jīng)安裝了Ruby。你可以通過運(yùn)行以下命令來檢查一下是否安裝有Ruby:
ruby -v
如果你沒有安裝Ruby,那么你需要先在你的Linux系統(tǒng)上安裝Ruby。在大多數(shù)Linux系統(tǒng)中,你可以使用你的包管理器來安裝Ruby。只需輸入以下命令:
sudo apt-get install ruby
此命令將安裝Ruby和其所有依賴項(xiàng)。在安裝完成后,你可以使用“ruby -v”命令再次檢查Ruby是否已正確安裝。
安裝Bundler
一旦Ruby已經(jīng)安裝完畢,現(xiàn)在你就可以開始安undle了。要安undle,請運(yùn)行以下命令:
sudo gem install bundler
這個(gè)命令將從Ruby官方的gem倉庫中下載Bundler的最新版本,并將其安裝在你的Linux系統(tǒng)上。在安裝完成后,你可以使用以下命令檢查bundle是否已正確安裝:
bundle -v
使用Bundler安裝和管理項(xiàng)目依賴項(xiàng)
安裝完bundle之后,你可以開始使用它來管理和安裝Ruby應(yīng)用程序所需的依賴項(xiàng)了。
要在你的項(xiàng)目中使用bundle,請首先將所有需要的依賴項(xiàng)寫入一個(gè)名為Gemfile的文件中。你可以使用你喜歡的編輯器打開此文件以添加或刪除依賴項(xiàng)。一個(gè)Gemfile示例如下:
source ‘https://rubygems.org’
gem ‘rls’
gem ‘sqlite3’
gem ‘rspec’
然后,運(yùn)行以下命令來安裝所有項(xiàng)目的依賴項(xiàng):
bundle install
此命令將檢查Gemfile中所列的所有依賴項(xiàng),并在本地系統(tǒng)上下載和安裝它們。
當(dāng)你需要添加、刪除或更新依賴項(xiàng)時(shí),只需更新Gemfile文件,并再次運(yùn)行“bundle install”即可。bundle將自動(dòng)管理所有依賴項(xiàng)的版本,以確保它們之間的兼容性。
在本文中,我們討論了在Linux上安undle的過程。要安undle,你需要先安裝Ruby,然后從官方的gem倉庫中下載并安undle。安裝完成后,你可以使用bundle來安裝和管理Ruby應(yīng)用程序所需的所有庫和依賴項(xiàng)。
成都網(wǎng)站建設(shè)公司-創(chuàng)新互聯(lián),建站經(jīng)驗(yàn)豐富以策略為先導(dǎo)10多年以來專注數(shù)字化網(wǎng)站建設(shè),提供企業(yè)網(wǎng)站建設(shè),高端網(wǎng)站設(shè)計(jì),響應(yīng)式網(wǎng)站制作,設(shè)計(jì)師量身打造品牌風(fēng)格,熱線:028-86922220linux下無cuda怎么pip安裝pytorch
linux下安裝caffe(無cuda)以及python接口
caffe(8)
主要過程稍微記錄一下:
1.安裝BLAS
sudo apt-get install libatlas-base-dev
2.安裝依賴項(xiàng)
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev protobuf-compiler liblmdb-dev
3.安裝glog
這個(gè)要FQ,我放在我的百度云上了。
tar zxvf glog-0.3.3.tar.gz
cd glog-0.3.3
./configure
make
sudo make install
4.安裝gflags
wget
unzip master.zip
cd gflags-master
mkdir build && cd build
export CXXFLAGS=”-fPIC” && cmake .. && make VERBOSE=1
make
sudo make install
這一步需要cmake,如果沒有安裝可以用 sudo apt-get install cmake 安裝。
5.安裝lmdb
git clone
cd mdb/libraries/liblmdb
make
sudo make install
如果沒有安裝Git,也要用 sudo apt-get install git 來安裝。
注:如果可以FQ,只用下面一句就可以安裝gflags,glog和lmdb了,省了3,4,5這三步。
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler
6.下鏈宏蠢載Caffe
git clone
7.安裝Caffe
cd caffe
cp Makefile.config.example Makefile.config
因?yàn)檫@里沒有g(shù)pu,所以需要設(shè)置Makefile.config文件中的CPU_ON:= 1,把這句的注釋去掉就可以了。
然后編譯
make all
make test
make runtest
安裝好以后我們棚陪就可以試著在mnist上跑一下lenet了。
1.首先獲取mnist數(shù)據(jù)
cd caffe
./data/mnist/get_mnist.sh
2.然后創(chuàng)建lenet
./examples/mnist/create_mnist.sh
注意一定要在caffe的根目錄下運(yùn)行以下命令,否則會(huì)報(bào)“ build/examples/mnist/convert_mnist_data.bin: not found”的錯(cuò)誤,參見這里。
3.訓(xùn)練cnn
沒有g(shù)pu的話要記得把caffe/examples/mnist/lenet_solver.prototxt中的solver_mode設(shè)置成solver_mode: CPU。然后在根目錄下執(zhí)行:
./examples/mnist/train_lenet.sh
準(zhǔn)確率可以達(dá)到0.9912
因絕鬧為caffe的tutorial上有很大一部分是Python的,所以后來又安裝了一下python的接口。
1.首先安裝python
2.安裝pip
sudo apt-get install python-pip python-dev build-essential
3.運(yùn)行以下代碼安裝必要的依賴項(xiàng):
sudo pip install -r ./python/requirements.txt
4.這里我運(yùn)行了make clean以及其他編譯的caffe的命令,重新編譯了一次caffe,但我不確定是不是必須的。
5.在caffe的根目錄下運(yùn)行:
make pycaffe
這里遇到了一個(gè)問題:
virtual memory exhausted: Cannot allocate memory
make: Error 1
按照這里的方法增加Linux虛擬機(jī)的內(nèi)存就可以解決了。
6.把caffe/python的路徑加到python路徑中:
運(yùn)行python進(jìn)入python shell,然后運(yùn)行下列命令:
import sys
sys.path.append(“path/to/caffe/python/”)
exit()
7. 這時(shí)候再次進(jìn)入python shell,運(yùn)行import caffe就沒有報(bào)錯(cuò)了。
1、先說清租一下什么是pip
pip 是“A tool for installing and managing Python packages.”,也就是說pip是python的軟件安裝工具
2、下面介紹怎么在linux下安裝pip
下載租正中pip到/usr/local/src
# cd /usr/local/src
# wget “” –no-check-certificate
如果提示:-bash: wget: command not found
那么安裝wget,執(zhí)行如下:
# yum -y install wget
解奪安裝pip
# tar -xzvf pip-1.5.4.tar.gz
# cd pip-1.5.4
# python setup.py install
如果安裝報(bào)下面的錯(cuò):
Traceback (most recent call last):
File “setup.py”, line 6, in
from setuptools import setup, find_packages
ImportError: No module named setuptools
那么就要先安裝setuptools包
(1)下載setuptools包
# wget
(2)解弊山壓setuptools包
# tar zxvf setuptools-2.0.tar.gz
# cd setuptools-2.0
(3)編譯setuptools
# python setup.py build
(4)開始執(zhí)行setuptools安裝
# python setup.py install
安裝完成setuptools包后,在重新執(zhí)行:
# cd /usr/local/src/pip-1.5.4
# python setup.py install
至此pip安裝完成
3、linux下pip使用參數(shù)
# pip –help
Usage:
pip
Commands:
installInstall packages.
uninstall Uninstall packages.
freezeOutput installed packages in requirements format.
listList installed packages.
showShow information about installed packages.
searchSearch PyPI for packages.
wheelBuild wheels from your requirements.
zipDEPRECATED. Zip individual packages.
unzipDEPRECATED. Unzip individual packages.
bundleDEPRECATED. Create pybundles.
helpShow help for commands.
General Options:
-h, –help Show help.
-v, –verbose Give more output. Option is additive, and can be used up to 3 times.
-V, –version Show version and exit.
-q, –quiet Give less output.
–log-filePath to a verbose non-appending log, that only logs failures. This log is active by default at /root/.pip/pip.log.
–log Path to a verbose appending log. This log is inactive by default.
–proxySpecify a proxy in the form proxy.server:port.
–timeoutSet the socket timeout (default 15 seconds).
–exists-action Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup.
linux 安undle的介紹就聊到這里吧,感謝你花時(shí)間閱讀本站內(nèi)容,更多關(guān)于linux 安undle,Linux 如何安undle?,linux下無cuda怎么pip安裝pytorch的信息別忘了在本站進(jìn)行查找喔。
成都創(chuàng)新互聯(lián)科技公司主營:網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、小程序制作、成都軟件開發(fā)、網(wǎng)頁設(shè)計(jì)、微信開發(fā)、成都小程序開發(fā)、網(wǎng)站制作、網(wǎng)站開發(fā)等業(yè)務(wù),是專業(yè)的成都做小程序公司、成都網(wǎng)站建設(shè)公司、成都做網(wǎng)站的公司。創(chuàng)新互聯(lián)公司集小程序制作創(chuàng)意,網(wǎng)站制作策劃,畫冊、網(wǎng)頁、VI設(shè)計(jì),網(wǎng)站、軟件、微信、小程序開發(fā)于一體。
文章標(biāo)題:Linux如何安undle?(linux安undle)
文章起源:http://fisionsoft.com.cn/article/ccohegi.html


咨詢
建站咨詢
