How to use Theano under Windows Pycharm

Source: Internet
Author: User
Tags theano

You need to install Anaconda and pycharm yourself before installing Theano. On the Internet to check the installation of Theano on the Pycharm method, but have encountered some problems, the problem and solutions are described below.

(i) The first type of mounting method

Open the CMD Command window or the Anaconda Command window and enter pip install Theano.

Enter after the download and installation of the progress bar, but this installation after the direct import Theano will be an error. So I used the second method.

(ii) Second type of installation

1. Manually download the Theano zip file

: Https://github.com/Theano/Theano, find Xxx/anaconda/lib/site-packages/theano after decompression ( there is a Theano folder in the file )

copy and paste this folder into E:/anaconda/lib/site-packages ) (This path is the path of your own anaconda).

2. See if there is a MinGW folder under your Anaconda path, and if so, skip to step 3rd.

Install the MinGW package below, cmd input Conda install MinGW Libpython, MinGW will be automatically installed under Anaconda.

3. Configure the environment variables.

Add environment variable: path:xxx/anaconda/mingw/bin; E:/anaconda/mingw/x86_64-w64-mingw32/lib; ( modify according to your own path )

(32bit e:/anaconda/mingw/i686-w64-mingw32/lib;)

New environment variable: Pythonpath:e:/anaconda/lib/site-packages/theano;

(iii) test Theano

CMD, enter python into the python environment, enter import Theano carriage return, if no error is configured successfully.

(iv) Problems that arise

1.warning (theano.configdefaults): G++not available, if using Conda: ' Conda install M2w64-toolchain '

     WARNING (theano.configdefaults): G++not detected! Theano'll be unable to Execute optimized c-imp

Workaround: Cmd window input conda install M2w64-toolchain

2.cmd Command Window input Conda list, see if there is no libpython, if not, then workaround:

CMD window input Conda install Libpython

3.Traceback (most recent):
File "", Line 1, in
File "E:\jing\Anaconda\lib\site-packages\theano__init__.py", line on, in from theano.compile import \
File "E:\jing\Anaconda\lib\site-packages\theano\compile__init__.py", line 9, in from Theano.compile.function_module Import *
File "E:\jing\Anaconda\lib\site-packages\theano\compile\function_module.py", line +, in from Theano import Gof
Importerror:cannot Import Name Gof

Obviously there is gof, but the display cannot be imported.

Workaround: In the "c:/users/User name" directory (depending on the computer, this may be different, if you do not know through the CMD query, the default is this path).

After locating this path, create a new ". Theanorc.txt" file and enter the following:

  [Global]

Openmp=false[Blas]ldflags=[GCC]cxxflags =-ic:/mingw/include 

(iv) Summary

I am in the process of installing some of the errors encountered and solutions, welcome to discuss.

  

How to use Theano under Windows Pycharm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.