Webpress部署教程

1.操作系统选Ubuntu

2.搭LAMP 教程:https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04

3.搭WordPress 教程:https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04

可能遇到的问题:

mysql装后登不进去 

1.服务器没开3306端口(在服务器设置上打开3306进出权限) 

2.mysql访问配置问题(解决:https://rbgeek.wordpress.com/2014/09/23/enable-remote-access-of-mysql-on-ubuntu/

DOS常用命令

DOS命令大全

第一部分:文件管理命令

1.append 命令:扩展打开文件的路径

2.assoc命令:文件名扩展关联

3.attrib命令:显示和修改文件属性

4.cacls命令:文件访问控制权限

5.cd/chdir命令:改变或显示当前目录

6.cipher命令:文件加密

7.comp命令:文件比较

8.copy命令:文件复制

9.del/erase命令:删除文件

10.deltree命令:删除目录树

11.dir命令 :显示目录

12.edit 命令:编辑

13.edlin命令:面向行的文本编辑器

14.expand命令:解压缩文件

15.extract命令:从安装盘提取文件

16.fc命令:文件比较

17.find命令:查找文本行

18.findstr命令:搜索文本

19.flattemp命令:管理临时文件目录

20.ftype命令:文件类型

21.mkdir/md命令:建立子目录

22.more命令:分频显示文件

23.path命令:设置命令行搜搜路径

24.popd命令:更改存储目录

25.pushd命令:存储当前目录

26.rename/ren命令:文件重命名

27.rmdir/rd命令:删除子目录

28.sort命令:数据排序

29.sys命令 :传送系统文件

30.type命令:现实文件内容

31.xcopy命令:子目录及文件复制

>>/<<命令:重定向命令的输入/输入

第二章:磁盘管理命令

1.chdsk命令:磁盘检查

2.chkntf命令:NTFS磁盘检查

3.compact命令:NTFS压缩

4.convert命令:分区格式转换

5.defrag命令:磁盘垃圾清理

6.diskcopy命令:磁盘全盘复制攻略

7.diskcomp命令:磁盘内容比较

8.diskpart命令:磁盘分区管理

9.fdisk命令:磁盘分区命令

10.fixboot命令:引导扇区的信息写入

11.fixmbr命令:修复扇区

12.format命令:磁盘格式化

13.label命令:创建、修改或删除驱动器的卷标

14.loadfix命令:装入固定内存

15.mountvol命令:设置装入点

16.scandisk 命令 :磁盘扫描

17.Subset命令:虚拟驱动器

18.vol命令:卷标

第三章:网络管理命令

1.arp命令:现实和修改本地Arp列表

2.ftp命令:文件的上传下载

3.getmac命令:网卡地址列表

4.hostname命令:主机名

5.ipconfig/winipcfg命令:查看网络配置信息

6.ipxroute命令:IPX路由

7.mstsc命令:远程桌面连接

8.nbstat命令:显示netbios协议的统计资料

9.net命令:基础网络

10.netdiag命令:网络故障高级诊断工具

11.netsh diagnostic命令:网络诊断

12.netstat命令:显示网络连接信息

13.pathping命令:路径测试

14.ping命令:网络连接测试

15.rasdial命令:自动建立连接

16.reset session命令:重置会话

17.route命令:显示和修改本地路由表

18.tlntadmn命令:服务器端管理

19.telnet命令:远程登录

20.tracert命令:数据包跟踪诊断

第四章 系统管理命令

1.chcp命令 :活动控制台代码页

2.cls命令:清屏

3.cmd命令:控制台管理

4.mmc命令:打开MMC

5.cmstp命令: “连接管理器”服务配置

6.color命令:字体及背景色的修改

7.country命令:国家设置

8.date命令:日期的修改

9.dcgpofix命令:组策略还原工具

10.debug命令:测试程序

11.device命令:加载程序

12.devicehigh命令:加载驱动程序到高端内存

13.doskey命令:命令管理程序

14.driverquery命令:查看设备驱动程序

15.dsmove 命令:移动对象

16.eventcreate命令:自定义事件

17.Eventquery命令:日志事件

18.eventtriggers命令:事件触发器

19.eventcmd命令:事件陷阱

20.finger命令:查看登录用户信息

21.gettype命令:设置系统环境变量

22.gpresult命令:查看组策略

23.gpupdate命令:刷新组策略

24.ipseccmd命令:在注册表中配置安全策略

25.logman命令:管理日志

26.mem命令:内存管理

27.mode命令:系统设置

28.ntsd命令:用户态调试工具

29.prompt命令:提示符

30.relog命令:到处性能管理日志文件

31.runas命令:作为其他用户运行

32.schtasks命令:任务计划

33.shutdown命令:自动关机

34.systeminfo命令:显示系统配置信息

35.tasklist命令 :进程查看

36.taskkill命令:进程管理

37.time命令:时间修改

38.title命令:创建标题

39.typeperf命令:性能计数器

40.unlodctr命令:删除计数器

41.ver命令:显示windows版本

42.w32tm命令:时间服务

第五章.活动目录管理命令

1.acldiag命令:诊断活动目录对象的许可权工具

2.adprep命令:域和林升级准备

3.dcdiag命令:域控制器诊断工具

4.dsacls命令:对象模板权限工具

5.dsadd命令:目录对象添加工具

6.dsget命令:显示目录对象属性

7.dsmod命令:修改目录对象

8.dsquery命令:查询活动目录

9.dsrm命令:删除目录对象

10.ldifde命令:目录对象处理工具

11.nltest命令:域信息处理高级工具

第六章 基础服务管理命令

1.lpd命令:打印队列

2.lpr命令:打印作业

3.net continue命令:服务恢复

4.net pause命令:服务恢复

5.net print命令:网络打印管理

6.net send命令:发送消息

7.net session命令:网络连接管理

8.net share命令:共享资源管理

9.netstart命令:启动服务

10.net stop命令:停止服务

11.net use命令:连接共享资源

12.net user命令:用户管理

13.net view命令:查看共享资源

14.netsh DHCP命令:管理DHCP服务

15.netsh WINS命令:管理WINS服务

16.netsh routing命令:管理路由服务

17.netshras命令:管理RAS服务

18.nslookup命令:管理DNS服务

19.print命令:打印

20.regsvr32命令:DLL文件注册

21.sc命令:服务控制

22.tcmsetup命令:设置TAPI

第七章 internet服务器管理命令

1.iisapp命令:IIS应用程序查询

2.iisback命令:IIS备份管理

3.iiscnfg命令:IIS配置

4.iisftp/setadprop命令:为用户设置activedirectory属性

5.iisftp/getadprop命令:为用户获得activedirectory属性

6.iisftp/query命令:显示本地和远程服务器上的FTP站点

7.iisftpdr/create命令:FTP虚拟目录建立工具

8.iisftpdr/delete命令:FTP虚拟目录删除工具

9.iisftpdr/query命令:FTP虚拟目录显示工具

10.iisreset命令:重启启动IIS

11.iisvdir/create命令:创建虚拟目录

12.iisvdir/delete命令:删除虚拟目录

13.iisvdir/query命令:显示虚拟目录

14.iisweb/create命令:创建新web站点

15.iisweb/stop命令:停止正在运行的站点

16.iisweb/pause命令:暂停正在运行的站点

17.iisweb/start命令:启动web站点

18.iisweb/delete命令:删除web站点

19.iisweb/query命令:查询web站点

第八章 自动笔处理文件和系统配置文件

1.buffers命令:分配缓冲区数目

2.break命令:扩展键检查

3.call命令:调用其他程序

4.choice命令:选择命令

5.cprofile命令:清理配置文件

6.dos命令:制定UMA链接

7.echo命令:隐藏正文

8.files命令:设置可存取文件数

9.for命令:循环执行命令

10.goto命令:指定行

11.if命令:条件判断

12.install命令:安装内存驻留程序

13.numlock命令:打开/关闭数字键盘

14.pause命令:暂停

15.rem命令:注释

16.set命令:设置环境变量

17.setlocal命令:环境变量的本地化

18.shell命令:指定解释程序

19.smartdrv命令:创建磁盘缓冲区

20.stacks命令:中断处理

21.switches命令:指定特殊项

Theano: installation

Installing Theano

Warning

If you want to install the bleeding-edge or development version of Theano from GitHub, please make sure you are reading the latest version of this page.

Requirements

In order to use Theano, the following libraries and software will need to be installed (MacOS and Windows users should refer to platform-specific instructions below for detailed installation steps):

Linux, Mac OS X or Windows operating system
We develop mainly on 64-bit Linux machines. other architectures are not well-tested.
Python 2 >= 2.6 or Python 3 >= 3.3
The development package (python-dev or python-devel on most Linux distributions) is recommended (see just below). Python 2.4 was supported up to and including the release 0.6. Python 3 is supported past the 3.3 release.
g++, python-dev
Not technically required but highly recommended, in order to compile generated C code. Theano can fall back on a NumPy-based Python execution model, but a C compiler allows for vastly faster execution. g++ >= 4.2 (for openmp that is currently always used) more recent version recommended!
NumPy >= 1.7.1
Earlier versions could work, but we don’t test it.
SciPy >= 0.11
Only currently required for sparse matrix and special functions support, but highlyrecommended. SciPy >=0.8 could work, but earlier versions have known bugs with sparse matrices.
A BLAS installation (with Level 3 functionality)
Including the development headers (-dev, -devel, depending on your Linux distribution). Mac OS X comes with the Accelerate framework built in, and various options exist for Windows (see below).

The following libraries and software are optional:

nose >= 1.3.0 and nose-parameterized >= 0.5.0
Recommended, to run Theano’s test-suite.
Sphinx >= 0.5.1, pygments
For building the documentation. LaTeX and dvipng are also necessary for math to show up as images.
Git
To download bleeding-edge versions of Theano.
graphiz and either pydot-ng or pydot
To be able to make picture of Theano computation graph. pydot-ng is a pydot compatible replacement that support newer Python.
NVIDIA CUDA drivers and SDK
Required for GPU code generation/execution on NVIDIA gpus
libgpuarray

Required for GPU/CPU code generation on CUDA and OpenCL devices (see: GpuArray Backend.)

note: OpenCL support is still minimal for now.

Linux

CentOS 6

Easy Installation of an optimized Theano on CentOS 6 provides instructions on how to install Theano on CentOS 6, written by the Theano developers. It covers how to install Theano (for CPU-based computation only) with the distribution-packaged ATLAS, a free fast implementation of BLAS.

Ubuntu

Easy Installation of an Optimized Theano on Current Ubuntu provides instructions on how to install Theano on Ubuntu. It covers how to install Theano with the distribution-packaged OpenBlas or ATLAS. Both are free fast implementation of BLAS.

Alternative installation on Gentoo

Brian Vandenberg emailed installation instructions on Gentoo, focusing on how to install the appropriate dependencies.

Nicolas Pinto provides ebuild scripts.

Alternative installation on Mandriva 2010.2

A contributor made rpm package for Mandriva 2010.2 of Theano 0.3.1.

 

Docker

Builds of Theano are available as Docker images: Theano Docker (CPU) or Theano Docker (CUDA). These are updated on a weekly basis with bleeding-edge builds of Theano. Examples of running bash in a Docker container are as follows:

sudo docker run -it kaixhin/theano
sudo nvidia-docker run -it kaixhin/cuda-theano:7.0

For a guide to Docker, see the official docs. CUDA support requires NVIDIA Docker. For more details on how to use the Theano Docker images, consult the source project.

Basic user install instructions

The easiest way to obtain the released version of Theano is from PyPI using pip (a replacement foreasy_install provided by setuptools/distribute) by typing

pip install Theano

This should work under Python 2 or Python 3. To test, run

nosetests theano

You may need to add sudo before the pip command to install into your system’s site-packagesdirectory. If you do not have administrator access to your machine, you can install Theano locally (to ~/.local) using

pip install Theano --user

Alternatively you can use virtualenv to create an isolated site-packages directory; see the virtualenv documentation for details.

Note

Theano can be installed with easy_install, however we recommend pip. pip offers many benefits over easy_install such as more intelligent dependency management, better error messages and a pip uninstall command for easily removing packages.

If you do not have pip installed but do have easy_install, you can get pip by simply typingeasy_install pip.

 

Updating Theano

The following command will update only Theano:

sudo pip install --upgrade --no-deps theano

The following command will update Theano and Numpy/Scipy (warning bellow):

sudo pip install --upgrade theano

If you installed NumPy/SciPy with yum/apt-get, updating NumPy/SciPy with pip/easy_install is not always a good idea. This can make Theano crash due to problems with BLAS (but see below). The versions of NumPy/SciPy in the distribution are sometimes linked against faster versions of BLAS. Installing NumPy/SciPy with yum/apt-get/pip/easy_install won’t install the development package needed to recompile it with the fast version. This mean that if you don’t install the development packages manually, when you recompile the updated NumPy/SciPy, it will compile with the slower version. This results in a slower Theano as well. To fix the crash, you can clear the Theano cache like this:

theano-cache clear

 

Bleeding-edge install instructions

Master Tests Status:

If you are a developer of Theano, then check out the Developer Start Guide.

If you want the bleeding-edge without developing the code you can use pip for this with the command line below. Note that it will also try to install Theano’s dependencies (like NumPy and SciPy), but not upgrade them. If you wish to upgrade them, remove the --no-deps switch to it, but go see a previous warning before doing this.

pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git

or (if you want to install it for the current user only):

pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git --user

The following are general instructions that will set you up with the bleeding-edge version of Theano and allow you to hack it. First, get the code using Git:

git clone git://github.com/Theano/Theano.git

From here, the easiest way to get started is (this requires setuptools or distribute to be installed):

cd Theano
python setup.py develop

This will install a .pth file in your site-packages directory that tells Python where to look for your Theano installation (i.e. in the directory your just checked out of Github). Using develop mode is preferable to install as any modifications you make in the checkout directory (or changes you pull with Git) will be automatically reflected in the “installed” version without re-runningpython setup.py install.

If you do not have permission to modify your site-packages directory you can specify an alternative installation prefix using

python setup.py develop --prefix=~/.local

A common choice is ~/.local which is automatically searched for Python >= 2.6; for earlier Python versions and other installation prefixes, the prefix specified must containlib/pythonA.B/site-packages, where A.B is e.g. 2.5, and this site-packages directory must be listed inPYTHONPATH.

An alternative, perhaps simpler way of creating and using an isolated site-packages is to usevirtualenv; see the virtualenv documentation for details. If you find yourself using virtualenv frequently you may find the virtualenvwrapper package useful for switching between them.

 

Configuring PYTHONPATH

If import theano does not work in Python, you may need modify the environment variablePYTHONPATH accordingly. In bash, you may do this:

export PYTHONPATH=<new location to add>:$PYTHONPATH

In csh:

setenv PYTHONPATH <new location to add>:$PYTHONPATH

To make this change stick you will usually need to add the above command to your shell’s startup script, i.e. ~/.bashrc or ~/.cshrc. Consult your shell’s documentation for details.

Updating

To update your library to the latest revision, change directory (cd) to your Theano folder and execute the following command:

git pull

You should update frequently, bugs are fixed on a very regular basis.

Specific git commit

You can install a specific git commit by using the bleeding edge instruction and adding @COMMIT_ID to the pip command like:

pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git@07e9332a0932e90c47ed2a70fc3c7f8a55d2aa23

 

Testing your installation

Once you have installed Theano, you should run the test suite. At a Python (or IPython) interpreter,

import theano
theano.test()

You can also run them in-place from the Git checkout directory by typing

theano-nose

You should be able to execute it if you followed the instructions above. If theano-nose is not found by your shell, you will need to add Theano/bin to your PATH environment variable.

Note

In Theano versions <= 0.5, theano-nose was not included. If you are working with such a version, you can call nosetests instead of theano-nose. In that case, some tests will fail by raising the KnownFailureTest Exception, and will be considered as errors, but they are nothing to worry about.

Note

The tests should be run with the configuration option device set to cpu (default). If you need to change this value, you can do that by setting the THEANO_FLAGS environment variable, by prefixing the theano-nose command with THEANO_FLAGS=device=cpu. If you have a GPU, it will automatically be used to run GPU-related tests.

If you want GPU-related tests to run on a specific GPU device, and not the default one, you should use init_gpu_device. For instance: THEANO_FLAGS=device=cpu,init_gpu_device=gpu1.

See config – Theano Configuration for more information on how to change these configuration options.

All tests should pass (skipped tests and known failures are normal). If some test fails on your machine, you are encouraged to tell us what went wrong on the theano-users@googlegroups.commailing list.

Troubleshooting: Make sure you have a BLAS library

There are many ways to configure BLAS for Theano. This is done with the Theano flags blas.ldflags(config – Theano Configuration). The default is to use the BLAS installation information in NumPy, accessible via numpy.distutils.__config__.show(). You can tell theano to use a different version of BLAS, in case you did not compile NumPy with a fast BLAS or if NumPy was compiled with a static library of BLAS (the latter is not supported in Theano).

The short way to configure the Theano flags blas.ldflags is by setting the environment variableTHEANO_FLAGS to blas.ldflags=XXX (in bash export THEANO_FLAGS=blas.ldflags=XXX)

The ${HOME}/.theanorc file is the simplest way to set a relatively permanent option like this one. Add a[blas] section with an ldflags entry like this:

# other stuff can go here
[blas]
ldflags = -lf77blas -latlas -lgfortran #put your flags here

# other stuff can go here

For more information on the formatting of ~/.theanorc and the configuration options that you can put there, see config – Theano Configuration.

Here are some different way to configure BLAS:

0) Do nothing and use the default config, which is to link against the same BLAS against which NumPy was built. This does not work in the case NumPy was compiled with a static library (e.g. ATLAS is compiled by default only as a static library).

1) Disable the usage of BLAS and fall back on NumPy for dot products. To do this, set the value ofblas.ldflags as the empty string (ex: export THEANO_FLAGS=blas.ldflags=). Depending on the kind of matrix operations your Theano code performs, this might slow some things down (vs. linking with BLAS directly).

2) You can install the default (reference) version of BLAS if the NumPy version (against which Theano links) does not work. If you have root or sudo access in fedora you can dosudo yum install blas blas-devel. Under Ubuntu/Debian sudo apt-get install libblas-dev. Then use the Theano flags blas.ldflags=-lblas. Note that the default version of blas is not optimized. Using an optimized version can give up to 10x speedups in the BLAS functions that we use.

3) Install the ATLAS library. ATLAS is an open source optimized version of BLAS. You can install a precompiled version on most OSes, but if you’re willing to invest the time, you can compile it to have a faster version (we have seen speed-ups of up to 3x, especially on more recent computers, against the precompiled one). On Fedora, sudo yum install atlas-devel. Under Ubuntu,sudo apt-get install libatlas-base-dev libatlas-base or libatlas3gf-sse2 if your CPU supports SSE2 instructions. Then set the Theano flags blas.ldflags to -lf77blas -latlas -lgfortran. Note that these flags are sometimes OS-dependent.

4) Use a faster version like MKL, GOTO, … You are on your own to install it. See the doc of that software and set the Theano flags blas.ldflags correctly (for example, for MKL this might be-lmkl -lguide -lpthread or-lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lguide -liomp5 -lmkl_mc -lpthread).

Note

Make sure your BLAS libraries are available as dynamically-loadable libraries. ATLAS is often installed only as a static library. Theano is not able to use this static library. Your ATLAS installation might need to be modified to provide dynamically loadable libraries. (On Linux this typically means a library whose name ends with .so. On Windows this will be a .dll, and on OS-X it might be either a .dylib or a .so.)

This might be just a problem with the way Theano passes compilation arguments to g++, but the problem is not fixed yet.

Note

If you have problems linking with MKL, Intel Line Advisor and the MKL User Guide can help you find the correct flags to use.

 

Using the GPU

The first thing you’ll need for Theano to use your GPU is Nvidia’s GPU-programming toolchain. You should install at least the CUDA driver and the CUDA Toolkit, as described here. The CUDA Toolkit installs a folder on your computer with subfolders bin, lib, include, and some more too. (Sanity check: The bin subfolder should contain an nvcc program which is the compiler for GPU code.) This folder is called the cuda root directory. You must also add the ‘lib’ subdirectory (and/or ‘lib64’ subdirectory if you have a 64-bit Linux computer) to your $LD_LIBRARY_PATH environment variable.

You must then tell Theano where the CUDA root folder is, and there are three ways to do it. Any one of them is enough.

  • Define a $CUDA_ROOT environment variable to equal the cuda root directory, as inCUDA_ROOT=/path/to/cuda/root, or
  • add a cuda.root flag to THEANO_FLAGS, as in THEANO_FLAGS='cuda.root=/path/to/cuda/root', or
  • add a [cuda] section to your .theanorc file containing the option root = /path/to/cuda/root.

Note

On Debian, you can ask the software package manager to install it for you. We have a user report that this works for Debian Wheezy (7.0). When you install it this way, you won’t always have the latest version, but we were told that it gets updated regularly. One big advantage is that it will be updated automatically. You can try the sudo apt-get install nvidia-cuda-toolkit command to install it.

Ubuntu instructions.

Once that is done, the only thing left is to change the device option to name the GPU device in your computer, and set the default floating point computations to float32. For example:THEANO_FLAGS='cuda.root=/path/to/cuda/root,device=gpu,floatX=float32'. You can also set these options in the .theanorc file’s [global] section:

[global]
device = gpu
floatX = float32

Note that:

  • If your computer has multiple GPUs and you use ‘device=gpu’, the driver selects the one to use (usually gpu0).
  • You can use the program nvida-smi to change this policy.
  • You can choose one specific GPU by specifying ‘device=gpuX’, with X the the corresponding GPU index (0, 1, 2, …)
  • By default, when device indicates preference for GPU computations, Theano will fall back to the CPU if there is a problem with the GPU. You can use the flag ‘force_device=True’ to instead raise an error when Theano cannot use the GPU.

Once your setup is complete, head to Using the GPU to find how to verify everything is working properly.

Mac OS

There are various ways to install Theano dependencies on a Mac. Here we describe the process in detail with Canopy, Anaconda, Homebrew or MacPorts but if you did it differently and it worked, please let us know the details on the theano-users mailing-list, so that we can add alternate instructions here.

In academia: Enthought Canopy

If you are working in academia, the easiest way to install most of the dependencies is to installCanopy. If you are affiliated with a university (as student or employee), you can download the installer for free.

The Canopy installation includes in particular Python (and the development headers), NumPy, SciPy, nose, sphinx, pip, pydot (but not Graphviz, which is necessary for it to work) and the MKL implementation of blas.

To install the latest Theano release execute this in a terminal:

$ pip install Theano

If you want the bleeding edge version execute this command instead:

$ pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git

See the section install_bleeding_edge for more information on the bleeding edge version.

Then you must install the compiler. See Installing the compiler below.

Note

If you use version 0.6 or later of Theano, we try to automatically link with the Canopy blas version. Due to Mac OS peculiarities, this requires user intervention. We detect if the manipulation was done or not and give an error message explaining what to do in case it hasn’t been done.

Anaconda

An easy way to install most of the dependencies is to install Anaconda. There is a free version available to everybody. If you install their MKL Optimizations product (free for academic, ~30$ otherwise) Theano will also be optimized as we will reuse the faster BLAS version automatically.

The Anaconda installation includes in particular Python (and the development headers), NumPy, SciPy, nose, sphinx, pip, and a acceptable BLAS version.

After installing Anaconda, in a terminal execute this command to install the latest Theano release:

$ pip install Theano

To install the missing Theano optional dependency (pydot):

$ conda install pydot-ng

If you want the bleeding edge version instead execute this command:

$ pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git

See the section install_bleeding_edge for more information on the bleeding edge version.

Then you must install the compiler. See Installing the compiler below.

Note

If you use version 0.6 or later of Theano, we try to automatically link with the python library. Due to Mac OS peculiarities, this requires user intervention. We detect if the user did the modification and if not, we tell him how to do it.

 

Installing the compiler

Theano officially supports only clang on OS X. This can be installed by getting XCode from the App Store and running it once to install the command-line tools.

If you still want to use g++ you can do so by setting its full path in the theano config flag gxx. Note that any bug reports on Mac using g++ will be ignored unless it can be reproduced with clang.

Homebrew

Install python with homebrew:

$ brew install python # or python3 if you prefer

This will install pip. Then use pip to install numpy, scipy:

$ pip install numpy scipy

If you want to use openblas instead of Accelerate, you have to install numpy and scipy with hombrew:

$ brew tap homebrew/python
$ brew install numpy --with-openblas
$ brew install scipy --with-openblas

Then install theano as usual:

$ pip install Theano --user

Or for the bleeding-edge version:

$ pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git

MacPorts

Using MacPorts to install all required Theano dependencies is easy, but be aware that it will take a long time (a few hours) to build and install everything.

  • MacPorts requires installing XCode first (which can be found in the Mac App Store), if you do not have it already. If you can’t install it from the App Store, look in your MacOS X installation DVD for an old version. Then update your Mac to update XCode.

  • Download and install MacPorts, then ensure its package list is up-to-date withsudo port selfupdate.

  • Then, in order to install one or more of the required libraries, use port install, e.g. as follows:

    $ sudo port install py27-numpy +atlas py27-scipy +atlas py27-pip
    

    This will install all the required Theano dependencies. gcc will be automatically installed (since it is a SciPy dependency), but be aware that it takes a long time to compile (hours)! Having NumPy and SciPy linked with ATLAS (an optimized BLAS implementation) is not mandatory, but recommended if you care about performance.

  • You might have some different versions of gcc, SciPy, NumPy, Python installed on your system, perhaps via Xcode. It is a good idea to use either the MacPorts version of everything or some other set of compatible versions (e.g. provided by Xcode or Fink). The advantages of MacPorts are the transparency with which everything can be installed and the fact that packages are updated quite frequently. The following steps describe how to make sure you are using the MacPorts version of these packages.

  • In order to use the MacPorts version of Python, you will probably need to explicitly select it withsudo port select python python27. The reason this is necessary is because you may have an Apple-provided Python (via, for example, an Xcode installation). After performing this step, you should check that the symbolic link provided by which python points to the MacPorts python. For instance, on MacOS X Lion with MacPorts 2.0.3, the output of which python is/opt/local/bin/python and this symbolic link points to /opt/local/bin/python2.7. When executingsudo port select python python27-apple (which you should not do), the link points to/usr/bin/python2.7.

  • Similarly, make sure that you are using the MacPorts-provided gcc: use sudo port select gcc to see which gcc installs you have on the system. Then execute for instancesudo port select gcc mp-gcc44 to create a symlink that points to the correct (MacPorts) gcc (version 4.4 in this case).

  • At this point, if you have not done so already, it may be a good idea to close and restart your terminal, to make sure all configuration changes are properly taken into account.

  • Afterwards, please check that the scipy module that is imported in Python is the right one (and is a recent one). For instance, import scipy followed by print(scipy.__version__) andprint(scipy.__path__) should result in a version number of at least 0.7.0 and a path that starts with /opt/local (the path where MacPorts installs its packages). If this is not the case, then you might have some old installation of scipy in your PYTHONPATH so you should edit PYTHONPATHaccordingly.

  • Please follow the same procedure with numpy.

  • This is covered in the MacPorts installation process, but make sure that your PATH environment variable contains /opt/local/bin and /opt/local/sbin before any other paths (to ensure that the Python and gcc binaries that you installed with MacPorts are visible first).

  • MacPorts does not create automatically nosetests and pip symlinks pointing to the MacPorts version, so you can add them yourself with

    $ sudo ln -s /opt/local/bin/nosetests-2.7 /opt/local/bin/nosetests
    $ sudo ln -s /opt/local/bin/pip-2.7 /opt/local/bin/pip
    
  • At this point you are ready to install Theano with

    $ sudo pip install Theano
    

    And if you are in no hurry, you can run its test-suite with

    $ python -c "import theano; theano.test()"
    

 

Using the GPU

You should be able to follow the Linux instructions to setup CUDA, but be aware of the following caveats:

  • If you want to compile the CUDA SDK code, you may need to temporarily revert back to Apple’s gcc (sudo port select gcc) as their Makefiles are not compatible with MacPort’s gcc.
  • If CUDA seems unable to find a CUDA-capable GPU, you may need to manually toggle your GPU on, which can be done with gfxCardStatus.

Once your setup is complete, head to Using the GPU to find how to verify everything is working properly.

Troubleshooting MacOS issues

Although the above steps should be enough, running Theano on a Mac may sometimes cause unexpected crashes, typically due to multiple versions of Python or other system libraries. If you encounter such problems, you may try the following.

  • You can ensure MacPorts shared libraries are given priority at run-time withexport LD_LIBRARY_PATH=/opt/local/lib:$LD_LIBRARY_PATH. In order to do the same at compile time, you can add to your ~/.theanorc:

    [gcc]
    cxxflags = -L/opt/local/lib
    
  • An obscure Bus error can sometimes be caused when linking Theano-generated object files against the framework library in Leopard. For this reason, we have disabled linking with -framework Python, since on most configurations this solves the Bus error problem. If this default configuration causes problems with your Python/Theano installation and you think that linking with -framework Python might help, then either set the THEANO_FLAGS environment variable withTHEANO_FLAGS=cmodule.mac_framework_link or edit your ~/.theanorc to contain

    [cmodule]
    mac_framework_link=True
    
  • More generally, to investigate libraries issues, you can use the otool -L command on .so files found under your ~/.theano directory. This will list shared libraries dependencies, and may help identify incompatibilities.

Please inform us if you have trouble installing and running Theano on your Mac. We would be especially interested in dependencies that we missed listing, alternate installation steps, GPU instructions, as well as tests that fail on your platform (use the theano-users@googlegroups.com mailing list, but note that you must first register to it, by going to theano-users).

Windows

Installation of Theano on Windows provides step-by-step instructions on how to install Theano on 32- or 64-bit Windows systems, using freely available tools and compilers.

Editing code in Visual Studio

You will find a Visual Studio solution file (Theano.sln) in the root of the Theano repository. Note that this project file may not be kept up-to-date and is not officially supported by the core Theano developers: it is provided for convenience only. Also, be aware that it will not make Theano use Visual Studio to compile C files: it is only meant to provide an easy way to edit Theano code within the Visual Studio editor.

Generating the documentation

You can read the latest HTML documentation here. You can download the latest PDF documentationhere.

We recommend you look at the documentation on the website, since it will be more current than the documentation included with the package.

If you really wish to build the documentation yourself, you will need sphinx, as described above. Issue the following command:

python ./doc/scripts/docgen.py

Documentation is built into html/. The PDF of the documentation is html/theano.pdf.

source: http://deeplearning.net/software/theano/install.html