如何用python3.6安装theano?

时间:2017-03-13 10:01:42

标签: python theano conda

我正在使用 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main22); askPermissions(); } private static String[] STR_ALL_PERMITTIONS = new String[]{ Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.SEND_SMS, }; private static final int RCODE_PERMISSION_ALL = 1; private int iAskingCounter = 0; private boolean doesAppNeedPermissions() { return android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1; } private void askPermissions() { if (doesAppNeedPermissions()) { Toast.makeText(this, "hi", Toast.LENGTH_SHORT).show(); iAskingCounter++; try { boolean isPermitted = isPermittedAllPermissions(this, STR_ALL_PERMITTIONS); if (!isPermitted) { if (iAskingCounter >= 20) { startNextIntent(); } else { ActivityCompat.requestPermissions(this, STR_ALL_PERMITTIONS, RCODE_PERMISSION_ALL); } return; } } catch (Exception e) { e.printStackTrace(); } } else { Toast.makeText(this, "helllo", Toast.LENGTH_SHORT).show(); } } private void startNextIntent() { Intent in = new Intent(Main22Activity.this, Main2Activity.class); startActivity(in); } private boolean isPermittedAllPermissions(Context context, String... sArrPermissions) { if (context == null || sArrPermissions == null) return true; for (String permission : sArrPermissions) { boolean shouldShow = ActivityCompat.shouldShowRequestPermissionRationale(this, permission); if (shouldShow) { //ActivityCompat.finishAffinity(this); } if (ContextCompat.checkSelfPermission(context, permission) != PackageManager.PERMISSION_GRANTED) { return false; } } return true; } @Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); askPermissions(); } public void playHandler(){ // where is I call it? Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { Intent in = new Intent(Main22Activity.this, Main2Activity.class); startActivity(in); } }, 1000); }使用python3.6安装theano但出现以下错误:

conda

似乎theano不适用于python3.6。这是我用python3.6安装它的方法吗?

5 个答案:

答案 0 :(得分:3)

不,Python 3.6上的theano没有conda包:

https://repo.continuum.io/pkgs/free/linux-64/

您可以选择2.7,3.4和3.5。

或者,您可以使用pip

从源代码构建Theano
pip install Theano

答案 1 :(得分:2)

使用python 3.6 for the Windows 10安装theano / pymc3

我发现一个让pymc3正常工作的装置存在严重问题。使用"导入pymc3"我通常会遇到致命的错误。根据许多博客贡献 - 我测试了所有.... - 它似乎确实是一个不完全稳定的程序。但是:基于Anaconda发行版,下面的内容对我有用(对于Jupyter也):

另见:http://deeplearning.net/software/theano/install_windows.html

  1. conda install theano
  2. conda install pygpu
  3. pip install pymc3(使用python 3.6时需要 pip

答案 2 :(得分:0)

此库没有conda包。

使用pip install Theano

您可能需要在pip命令之前添加sudo以安装到系统的site-packages目录中。如果您没有计算机的管理员权限,可以使用

在本地安装Theano(到〜/ .local)

pip install Theano --user

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

答案 3 :(得分:0)

Python 3.6需要pip3来安装Theano软件包。

$git clone git://github.com/Theano/Theano.git
$cd Theano
$sudo pip3 install -e .

答案 4 :(得分:0)

如果您希望选择以下版本之一,则无法在Python 3.6上安装theano:

Python == 2.7* or ( >= 3.3 and < 3.6 )