小编KDo*_*ogg的帖子

用Anaconda安装了一个包,不能用Python导入

原谅我,但我是python的新手.我已经安装了一个包(theano) conda install theano,当我输入时conda list,包存在

但是,当我通过运行进入python解释器python并尝试导入它时import theano,我得到一个错误:"没有名为theano的模块",当我列出所有python模块时,theano不存在.

我错过了什么?

python install package python-3.x anaconda

12
推荐指数
2
解决办法
2万
查看次数

Elastic Beanstalk Http重定向到Https

我知道之前已经问过这个问题,但似乎没有什么对我有用.我尝试过多种不同的东西,例如这些问题中描述的答案:

如何让Elastic Beanstalk nginx支持的代理服务器从HTTP自动重定向到HTTPS? 将EC2 elb从http重定向到https

他们似乎都没有工作.我是一个aws noob,所以我不完全确定如何编辑配置文件 - 或者我是否做错了什么.

我的设置如下:

我当前的.ebextensions文件夹中的nginx.config文件(从本文中获取):

files:
  "/tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf" :
    mode: "000755"
    owner: root
    group: root
    content: |
        upstream nodejs {
            server 127.0.0.1:8081;
            keepalive 256;
        }
        server {
            listen 8080;
            set $fixedWWW '';
            set $needRedir 0;
            # nginx does not allow nested if statements
            # check and decide on adding www prefix
            if ($host !~* ^www(.*)) {
                set $fixedWWW 'www.';
                set $needRedir 1;
            }
            # what …
Run Code Online (Sandbox Code Playgroud)

https nginx amazon-web-services amazon-elb amazon-elastic-beanstalk

9
推荐指数
1
解决办法
1987
查看次数

Mongoose 将 _id 保存为字符串而不是 ObjectId

将 Nodejs 与 Mongodb 和 Mongoose 结合使用。

我刚刚发现 Mongoose/Mongodb 已将自动生成的 _id 字段保存为字符串而不是 ObjectId。Mongodb shell 输出和示例文档:

> db.users.count({_id: {$type: 7}})
2
> db.users.count({_id: {$type: 2}})
4266

> db.users.find({_id: {$type: 7}},{_id:1}).limit(1)
{ "_id" : ObjectId("55f7df6fdb8aa078465ec6ec") }
> db.users.find({_id: {$type: 2}},{_id:1}).limit(1)
{ "_id" : "558c3472c8ec50de6e560ecd" }
Run Code Online (Sandbox Code Playgroud)

4266 _id(字符串)来自以下代码:

var newUser = new ApiUser();

newUser.name = name;
newUser.link = link;
newUser.signupTime = new Date().getTime();
newUser.initialBrowser = initialBrowser;

newUser.save(function(err) {
     if (err)
          res.json(err);
     else
          res.json('success');
});
Run Code Online (Sandbox Code Playgroud)

2 个 _id (ObjectId) 来自以下代码:

var newUser            = new …
Run Code Online (Sandbox Code Playgroud)

mongoose mongodb node.js

5
推荐指数
1
解决办法
5301
查看次数