python无法打开设置,“python:无法打开文件”manage.py“:[Errno 2]没有这样的文件或目录”运行tmux shell脚本时?...

I am trying to run a very simple tmux shell script called "split.sh" which splits the terminal windows.

split.sh:

#!/bin/bash

~/build/tmux-1.5/tmux split-window -h

~/build/tmux-1.5/tmux split-window -v

~/build/tmux-1.5/tmux split-window -h

When I type the command "sh ~/build/tmux-1.5/split.sh", this shell script runs fine, splitting the terminal windows.

However, when I set an aliases,

alias sp='sh ~/build/tmux-1.5/split.sh'

and then run "sp", the terminal gives me a wierd error:

python: can't open file 'manage.py': [Errno 2] No such file

I believe this error with "manage.py" has something to do with Django.. but I have no idea why terminal is looking for manage.py. Why is the terminal giving me this error :(???

Thanks.

解决方案

I faced the same problem. 'manage.py' was in the directory but still was having this issue.

python: can't open file 'manage.py': [Errno 2] No such file or directory

What I did was that mentioned complete path to the project where manage.py was located like this and ran the command successfully! it's because the file was located in a subdirectory. You need to either enter the appropriate subdirectory or add it to the filename as I did below

python C:\Users\myuser\python_projects\myproject\manage.py syncdb

Hopefully that will help you to resolve the issue.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值