通过pip安装scipy时:
pip install scipy
Run Code Online (Sandbox Code Playgroud)
Pip无法构建scipy并抛出以下错误:
Cleaning up...
Command /Users/administrator/dev/KaggleAux/env/bin/python2.7 -c "import setuptools, tokenize;__file__='/Users/administrator/dev/KaggleAux/env/build/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/zl/7698ng4d4nxd49q1845jd9340000gn/T/pip-eO8gua-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/administrator/dev/KaggleAux/env/bin/../include/site/python2.7 failed with error code 1 in /Users/administrator/dev/KaggleAux/env/build/scipy
Storing debug log for failure in /Users/administrator/.pip/pip.log
Run Code Online (Sandbox Code Playgroud)
我怎样才能成功建立scipy?这可能是OSX Yosemite的一个新问题,因为我刚刚升级并且之前没有安装过scipy的问题.
调试日志:
Cleaning up...
Removing temporary dir /Users/administrator/dev/KaggleAux/env/build...
Command /Users/administrator/dev/KaggleAux/env/bin/python2.7 -c "import setuptools, tokenize;__file__='/Users/administrator/dev/KaggleAux/env/build/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/zl/7698ng4d4nxd49q1845jd9340000gn/T/pip-eO8gua-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/administrator/dev/KaggleAux/env/bin/../include/site/python2.7 failed with error code 1 in /Users/administrator/dev/KaggleAux/env/build/scipy
Exception information:
Traceback (most recent call last): …Run Code Online (Sandbox Code Playgroud) 我已经通过apt-get安装了virtualenv和virtualwrapper,我得到了一个创建虚拟环境的点,但是后来在我使用workon命令的那天晚些时候找不到它.我进一步去检查我的主目录和.virtualenvs目录,我之前创建的virtualenv仍然存在...任何帮助将不胜感激.提前致谢.
我是Python的新手,所以这可能听起来很傻.
我想使用我在Github上找到的Python库,让我们说https://github.com/praw-dev/praw,我希望git pull将来能够提取最新的提交.
问题:我应该git clone <git url>在项目目录中删除除praw目录之外的所有内容,然后在我的python脚本中做一个import praw?
在iPython中,
import praw
Run Code Online (Sandbox Code Playgroud)
给出了错误 ImportError: No module named praw
目录结构
~\myProject\
praw\
myNotebook.ipynb
Run Code Online (Sandbox Code Playgroud) 考虑这个基本菜单:
<ul class="nav navbar-nav">
<li class="active"><a href="{% url 'home' %}">Home</a></li>
<li><a href="{% url 'about' %}">About</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud)
我试图给当前页面的链接一个活动的类,我想基于当前的url和视图的url动态地执行此操作.因此,当用户访问about页面时,该页面现在具有活动类,而主页不具有.
我想逻辑在<li></li>标签内部这样工作:
{% if request.get_full_path = "{% url 'home' %}" %}class="active"{% endif %}
{% if request.get_full_path = "{% url 'about' %}" %}class="active"{% endif %}
Run Code Online (Sandbox Code Playgroud)
但显然我不能{% ... %}互相嵌套两个.
关于如何绕过这两个的任何想法?
我部署了我的django应用程序,当我尝试时
heroku run python manage.py syncdb
Run Code Online (Sandbox Code Playgroud)
我有一个等待进程错误的超时.尚未为系统创建超级用户,尽管我使用以下命令执行syncdb:
heroku run:detached python manage.py createsuperuser
Run Code Online (Sandbox Code Playgroud)
但这并没有促使我为超级用户.
我的系统中没有阻止端口5000.如何让heroku运行(或)如何创建超级用户?
我试图使用flask显示浏览器中连接设备的列表.我在端口8000上启用了烧瓶:
在server.py中:
@server.route('/devices',methods = ['GET'])
def status():
return app.stat()
if __name__ == '__main__':
app.run()
Run Code Online (Sandbox Code Playgroud)
在app.py中:
def stat():
return(glob.glob("/dev/tty57") + glob.glob("/dev/tty9"))
Run Code Online (Sandbox Code Playgroud)
这是我的考验:
url = "http://127.0.0.1:8000"
response = requests.get(url + "").text
print response
Run Code Online (Sandbox Code Playgroud)
但我一直收到这个错误:
"TypeError": 'list' object is not callable.
Run Code Online (Sandbox Code Playgroud)
我在检查ttyUSB,...和其他设备是否存在时做错了吗?
我有一个表单中的输入按钮,当它提交时应该重定向两个参数,search_val并且i,到一个more_results()函数,(在下面列出),但是当wsgi构建时我得到一个类型错误.
错误是: TypeError: more_results() takes exactly 2 arguments (1 given)
HTML:
<form action="{{ url_for('more_results', past_val=search_val, ind=i ) }}" method=post>
<input id='next_hutch' type=submit value="Get the next Hunch!" name='action'>
</form>
Run Code Online (Sandbox Code Playgroud)
烧瓶功能:
@app.route('/results/more_<past_val>_hunches', methods=['POST'])
def more_results(past_val, ind):
if request.form["action"] == "Get the next Hunch!":
ind += 1
queried_resturants = hf.find_lunch(past_val) #method to generate a list
queried_resturants = queried_resturants[ind]
return render_template(
'show_entries.html',
queried_resturants=queried_resturants,
search_val=past_val,
i=ind
)
Run Code Online (Sandbox Code Playgroud)
有关如何克服构建错误的任何想法?
使用url_for()的多个参数
类似的构建错误
作为旁注,该功能的目的是当有人点击"下一页"按钮时迭代列表.我正在传递变量,i所以我可以引用继续递增列表.是否有更好的烧瓶/ jinja 2方法?我查看了cycling_list功能,但它似乎无法用于呈现页面然后重新呈现它 …
我有一个Gruntfile写在CoffeeScript我不断收到(Error code: EISDIR)的时候cssmin运行任务.以详细模式运行任务后,我得到以下信息:
Running "cssmin" task
Running "cssmin:src" (cssmin) task
Verifying property cssmin.src exists in config...OK
Files: assets/z.styles.concat.css.liquid -> src
Options: report=false
Reading assets/z.styles.concat.css.liquid...OK
Writing src...ERROR
Warning: Unable to write "src" file (Error code: EISDIR). Use --force to continue.
Run Code Online (Sandbox Code Playgroud)
这是我的cssmin任务:
cssmin:
src: 'assets/z.styles.concat.css.liquid'
dest: 'assets/styles.min.css.liquid'
Run Code Online (Sandbox Code Playgroud)
在z.styles.concat.css.liquid被创建后concat运行,并成功输出到资产的文件夹.src属性中列出的路径是正确的.
有什么想法可以抛出错误吗?
此外,这里是整个gruntfile的connivence.
Grunt.coffee:
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
files:
grunt: ['gruntfile.js']
css: ['assets/screen.css', 'assets/styles.css.liquid']
scss: ['src/scss/**/*.scss'] …Run Code Online (Sandbox Code Playgroud) 使用Atom的Tree View软件包,可以轻松隐藏被忽略的文件和VCS忽略的文件.
如何从此忽略中排除某些文件?
为什么?
我仍然希望能够访问包含在其中的文件node_modules,(知道导入路径,检查包ReadMes等),但我不想将它们检入git.由于它们没有被检入git,我无法检查这些包,因为它们被Tree View隐藏了.
有没有办法可以从Tree View中忽略某些名称?
useState 即使数据的值没有改变,也总是触发更新。
这是问题的工作演示:demo
我正在使用useState钩子来更新一个对象,我试图让它只在该对象中的值发生变化时才更新。因为 React 使用Object.is比较算法来决定什么时候应该更新;具有等效值的对象仍然会导致组件重新渲染,因为它们是不同的对象。
前任。即使有效载荷的值保持不变,该组件也将始终重新渲染{ foo: 'bar' }
const UseStateWithNewObject = () => {
const [payload, setPayload] = useState({});
useEffect(
() => {
setInterval(() => {
setPayload({ foo: 'bar' });
}, 500);
},
[setPayload]
);
renderCountNewObject += 1;
return <h3>A new object, even with the same values, will always cause a render: {renderCountNewObject}</h3>;
};
Run Code Online (Sandbox Code Playgroud)
有没有我可以shouldComponentUpdate用钩子实现类似的东西来告诉反应只在数据更改时重新渲染我的组件?
python ×5
django ×2
flask ×2
javascript ×2
atom-editor ×1
coffeescript ×1
git ×1
github ×1
gruntjs ×1
heroku ×1
html ×1
ipython ×1
linux ×1
python-2.7 ×1
react-hooks ×1
reactjs ×1
scipy ×1
terminal ×1
ubuntu ×1
virtualenv ×1